cc-codeconductor 1.4.1 → 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/README.md +61 -13
- package/dist/core/verification/rdd-receipt.d.ts +39 -0
- package/dist/core/verification/verification-runner.d.ts +8 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1257 -330
- package/dist/library.js +267 -26
- package/dist/validation/schemas.d.ts +521 -26
- package/docs/generated/cli.md +20 -0
- package/package.json +1 -1
- package/presets/agy/AGENTS.md +6 -0
- package/presets/agy/README.md +1 -1
- package/presets/agy/hooks.json +1 -1
- package/presets/agy/scripts/invoke-hook.cjs +20 -5
- package/presets/agy/settings.json +1 -1
- package/presets/agy/skills/api-versioning/SKILL.md +394 -0
- package/presets/agy/skills/astro/SKILL.md +318 -0
- package/presets/agy/skills/auth-token-inspector/SKILL.md +30 -0
- package/presets/agy/skills/cc-pagespeed/SKILL.md +2 -3
- package/presets/agy/skills/code-review/SKILL.md +207 -0
- package/presets/agy/skills/django-orm/SKILL.md +460 -0
- package/presets/agy/skills/django-uv/SKILL.md +405 -0
- package/presets/agy/skills/drizzle-schema-architect/SKILL.md +50 -0
- package/presets/agy/skills/fastapi-pydantic-strict/SKILL.md +43 -0
- package/presets/agy/skills/jpa-nplusone-detector/SKILL.md +45 -0
- package/presets/agy/skills/jpa-postgres/SKILL.md +623 -0
- package/presets/agy/skills/livewire-alpine-bridge/SKILL.md +35 -0
- package/presets/agy/skills/nextjs-typescript/SKILL.md +390 -0
- package/presets/agy/skills/python/SKILL.md +611 -0
- package/presets/agy/skills/seo-analytics-injector/SKILL.md +43 -0
- package/presets/agy/skills/spring-auth-auditor/SKILL.md +29 -0
- package/presets/agy/skills/spring-boot-feature/SKILL.md +563 -0
- package/presets/agy/skills/spring-boot-testing-strategy/SKILL.md +475 -0
- package/presets/agy/skills/tailwind-responsive-auditor/SKILL.md +29 -0
- package/presets/agy/skills/tdd-mutation-tester/SKILL.md +27 -0
- package/presets/agy/workflows/cc-handoff.md +2 -1
- package/presets/agy/workflows/cc-odd.md +15 -0
- package/presets/agy/workflows/cc-pagespeed.md +2 -3
- package/presets/agy/workflows/cc-review.md +31 -0
- package/presets/agy/workflows/cc-security.md +1 -1
- package/presets/claude/CLAUDE.md +6 -0
- package/presets/claude/commands/cc/handoff.md +2 -1
- package/presets/claude/commands/cc/odd.md +15 -0
- package/presets/claude/commands/cc/review.md +33 -0
- package/presets/claude/settings.json +2 -2
- package/presets/claude/skills/android/SKILL.md +1 -1
- package/presets/claude/skills/api-versioning/SKILL.md +1 -1
- package/presets/claude/skills/astro/SKILL.md +318 -0
- package/presets/claude/skills/auth-token-inspector/SKILL.md +30 -0
- package/presets/claude/skills/code-review/SKILL.md +207 -0
- package/presets/claude/skills/django-orm/SKILL.md +1 -1
- package/presets/claude/skills/django-testing/SKILL.md +1 -1
- package/presets/claude/skills/django-uv/SKILL.md +405 -0
- package/presets/claude/skills/drizzle-schema-architect/SKILL.md +50 -0
- package/presets/claude/skills/fastapi-pydantic-strict/SKILL.md +43 -0
- package/presets/claude/skills/jpa-nplusone-detector/SKILL.md +45 -0
- package/presets/claude/skills/jpa-postgres/SKILL.md +1 -1
- package/presets/claude/skills/livewire-alpine-bridge/SKILL.md +35 -0
- package/presets/claude/skills/nextjs-typescript/SKILL.md +390 -0
- package/presets/claude/skills/pagespeed-perf/SKILL.md +1 -1
- package/presets/claude/skills/python/SKILL.md +1 -1
- package/presets/claude/skills/python-django-stack/SKILL.md +1 -1
- package/presets/claude/skills/python-fastapi-stack/SKILL.md +1 -1
- package/presets/claude/skills/security/SKILL.md +1 -1
- package/presets/claude/skills/seo-analytics-injector/SKILL.md +43 -0
- package/presets/claude/skills/spring-auth-auditor/SKILL.md +29 -0
- package/presets/claude/skills/spring-boot-feature/SKILL.md +1 -1
- package/presets/claude/skills/spring-boot-kotlin/SKILL.md +1 -1
- package/presets/claude/skills/spring-boot-testing-strategy/SKILL.md +475 -0
- package/presets/claude/skills/sqlalchemy/SKILL.md +1 -1
- package/presets/claude/skills/tailwind-responsive-auditor/SKILL.md +29 -0
- package/presets/claude/skills/tdd-mutation-tester/SKILL.md +27 -0
- package/presets/claude/skills/testing-strategy/SKILL.md +1 -1
- package/presets/codex/AGENTS.md +6 -0
- package/presets/codex/skills/android/SKILL.md +1 -1
- package/presets/codex/skills/api-versioning/SKILL.md +1 -1
- package/presets/codex/skills/astro/SKILL.md +318 -0
- package/presets/codex/skills/auth-token-inspector/SKILL.md +30 -0
- package/presets/codex/skills/cc-handoff/SKILL.md +3 -1
- package/presets/codex/skills/cc-odd/SKILL.md +25 -0
- package/presets/codex/skills/cc-openspec/SKILL.md +5 -1
- package/presets/codex/skills/cc-pagespeed/SKILL.md +2 -3
- package/presets/codex/skills/cc-review/SKILL.md +31 -0
- package/presets/codex/skills/cc-security/SKILL.md +1 -1
- package/presets/codex/skills/cc-spec-mutation/SKILL.md +5 -0
- package/presets/codex/skills/cc-tdd-cycle/SKILL.md +8 -0
- package/presets/codex/skills/code-review/SKILL.md +207 -0
- package/presets/codex/skills/django-orm/SKILL.md +1 -1
- package/presets/codex/skills/django-testing/SKILL.md +1 -1
- package/presets/codex/skills/django-uv/SKILL.md +405 -0
- package/presets/codex/skills/drizzle-schema-architect/SKILL.md +50 -0
- package/presets/codex/skills/fastapi-pydantic-strict/SKILL.md +43 -0
- package/presets/codex/skills/jpa-nplusone-detector/SKILL.md +45 -0
- package/presets/codex/skills/jpa-postgres/SKILL.md +1 -1
- package/presets/codex/skills/livewire-alpine-bridge/SKILL.md +35 -0
- package/presets/codex/skills/nextjs-typescript/SKILL.md +390 -0
- package/presets/codex/skills/pagespeed-perf/SKILL.md +1 -1
- package/presets/codex/skills/python/SKILL.md +1 -1
- package/presets/codex/skills/python-django-stack/SKILL.md +1 -1
- package/presets/codex/skills/python-fastapi-stack/SKILL.md +1 -1
- package/presets/codex/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/codex/skills/security-blue-team/SKILL.md +43 -0
- package/presets/codex/skills/security-cloud/SKILL.md +43 -0
- package/presets/codex/skills/security-crypto/SKILL.md +43 -0
- package/presets/codex/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/codex/skills/security-grc/SKILL.md +43 -0
- package/presets/codex/skills/security-incident-response/SKILL.md +45 -0
- package/presets/codex/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/codex/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/codex/skills/security-mobile/SKILL.md +43 -0
- package/presets/codex/skills/security-network/SKILL.md +43 -0
- package/presets/codex/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/codex/skills/security-recon/SKILL.md +45 -0
- package/presets/codex/skills/security-red-team/SKILL.md +44 -0
- package/presets/codex/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/codex/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/codex/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/codex/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/codex/skills/security-web/SKILL.md +44 -0
- package/presets/codex/skills/seo-analytics-injector/SKILL.md +43 -0
- package/presets/codex/skills/spring-auth-auditor/SKILL.md +29 -0
- package/presets/codex/skills/spring-boot-feature/SKILL.md +2 -2
- package/presets/codex/skills/spring-boot-kotlin/SKILL.md +1 -1
- package/presets/codex/skills/spring-boot-testing-strategy/SKILL.md +475 -0
- package/presets/codex/skills/sqlalchemy/SKILL.md +1 -1
- package/presets/codex/skills/tailwind-responsive-auditor/SKILL.md +29 -0
- package/presets/codex/skills/tdd-mutation-tester/SKILL.md +27 -0
- package/presets/codex/skills/testing-strategy/SKILL.md +1 -1
- package/presets/cursor/AGENTS.md +6 -0
- package/presets/cursor/commands/cc/handoff.md +3 -1
- package/presets/cursor/commands/cc/odd.md +20 -0
- package/presets/cursor/commands/cc/openspec.md +5 -1
- package/presets/cursor/commands/cc/pagespeed.md +2 -3
- package/presets/cursor/commands/cc/review.md +31 -0
- package/presets/cursor/commands/cc/security.md +1 -1
- package/presets/cursor/commands/cc/spec-mutation.md +5 -0
- package/presets/cursor/commands/cc/tdd-cycle.md +8 -0
- package/presets/cursor/skills/android/SKILL.md +1 -1
- package/presets/cursor/skills/api-versioning/SKILL.md +2 -1
- package/presets/cursor/skills/astro/SKILL.md +1 -1
- package/presets/cursor/skills/auth-token-inspector/SKILL.md +1 -1
- package/presets/cursor/skills/code-review/SKILL.md +1 -1
- package/presets/cursor/skills/django-orm/SKILL.md +3 -5
- package/presets/cursor/skills/django-testing/SKILL.md +1 -1
- package/presets/cursor/skills/django-uv/SKILL.md +1 -1
- package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +1 -1
- package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +1 -1
- package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +1 -1
- package/presets/cursor/skills/jpa-postgres/SKILL.md +2 -4
- package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +1 -1
- package/presets/cursor/skills/nextjs-typescript/SKILL.md +1 -1
- package/presets/cursor/skills/pagespeed-perf/SKILL.md +1 -1
- package/presets/cursor/skills/python/SKILL.md +6 -7
- package/presets/cursor/skills/python-django-stack/SKILL.md +1 -1
- package/presets/cursor/skills/python-fastapi-stack/SKILL.md +1 -1
- package/presets/cursor/skills/security/SKILL.md +1 -1
- package/presets/cursor/skills/seo-analytics-injector/SKILL.md +1 -1
- package/presets/cursor/skills/spring-auth-auditor/SKILL.md +1 -1
- package/presets/cursor/skills/spring-boot-feature/SKILL.md +2 -4
- package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +1 -1
- package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +1 -1
- package/presets/cursor/skills/sqlalchemy/SKILL.md +1 -1
- package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +1 -1
- package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +1 -1
- package/presets/gemini/GEMINI.md +6 -0
- package/presets/gemini/commands/cc/handoff.toml +3 -1
- package/presets/gemini/commands/cc/odd.toml +20 -0
- package/presets/gemini/commands/cc/openspec.toml +5 -1
- package/presets/gemini/commands/cc/pagespeed.toml +2 -3
- package/presets/gemini/commands/cc/review.toml +31 -0
- package/presets/gemini/commands/cc/security.toml +1 -1
- package/presets/gemini/commands/cc/spec-mutation.toml +5 -0
- package/presets/gemini/commands/cc/tdd-cycle.toml +8 -0
- package/presets/opencode/README.md +45 -52
- package/presets/opencode/agents/implementer.md +2 -0
- package/presets/opencode/agents/reviewer.md +2 -0
- package/presets/opencode/agents/tester.md +2 -0
- package/presets/opencode/commands/cc-handoff.md +2 -1
- package/presets/opencode/commands/cc-odd.md +15 -0
- package/presets/opencode/commands/cc-pagespeed.md +2 -3
- package/presets/opencode/commands/cc-review.md +31 -0
- package/presets/opencode/commands/cc-security.md +1 -1
- package/presets/opencode/opencode.jsonc +1 -1
- package/presets/opencode/skills/android/SKILL.md +1 -1
- package/presets/opencode/skills/api-versioning/SKILL.md +2 -1
- package/presets/opencode/skills/astro/SKILL.md +1 -1
- package/presets/opencode/skills/auth-token-inspector/SKILL.md +1 -1
- package/presets/opencode/skills/code-review/SKILL.md +1 -1
- package/presets/opencode/skills/django-orm/SKILL.md +3 -3
- package/presets/opencode/skills/django-testing/SKILL.md +1 -1
- package/presets/opencode/skills/django-uv/SKILL.md +1 -1
- package/presets/opencode/skills/drizzle-schema-architect/SKILL.md +1 -1
- package/presets/opencode/skills/fastapi-pydantic-strict/SKILL.md +1 -1
- package/presets/opencode/skills/jpa-nplusone-detector/SKILL.md +1 -1
- package/presets/opencode/skills/jpa-postgres/SKILL.md +2 -1
- package/presets/opencode/skills/livewire-alpine-bridge/SKILL.md +1 -1
- package/presets/opencode/skills/nextjs-typescript/SKILL.md +1 -1
- package/presets/opencode/skills/pagespeed-perf/SKILL.md +1 -1
- package/presets/opencode/skills/python/SKILL.md +6 -5
- package/presets/opencode/skills/python-django-stack/SKILL.md +1 -1
- package/presets/opencode/skills/python-fastapi-stack/SKILL.md +1 -1
- package/presets/opencode/skills/security/SKILL.md +1 -1
- package/presets/opencode/skills/seo-analytics-injector/SKILL.md +1 -1
- package/presets/opencode/skills/spring-auth-auditor/SKILL.md +1 -1
- package/presets/opencode/skills/spring-boot-feature/SKILL.md +2 -1
- package/presets/opencode/skills/spring-boot-kotlin/SKILL.md +1 -1
- package/presets/opencode/skills/spring-boot-testing-strategy/SKILL.md +1 -1
- package/presets/opencode/skills/sqlalchemy/SKILL.md +1 -1
- package/presets/opencode/skills/tailwind-responsive-auditor/SKILL.md +1 -1
- package/presets/opencode/skills/tdd-mutation-tester/SKILL.md +1 -1
- package/presets/pi/AGENTS.md +6 -0
- package/presets/seo-hotel/skills/astro-seo/SKILL.md +1 -1
- package/presets/seo-hotel/skills/geo-readiness/SKILL.md +1 -1
- package/presets/seo-hotel/skills/off-page/SKILL.md +1 -1
- package/presets/seo-hotel/skills/schema-validator/SKILL.md +1 -1
- package/presets/seo-hotel/skills/seo-audit/SKILL.md +1 -1
- package/presets/shared/invoke-hook.cjs +20 -5
- package/src/presets/models/roles.yml +28 -28
- package/src/presets/shared-skills.yml +58 -22
- package/src/presets/targets/pi.yml +1 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: astro
|
|
3
|
+
name: astro
|
|
4
|
+
description: >
|
|
5
|
+
Provides expert knowledge for building Astro 5+ sites with Islands Architecture, Content Collections, TypeScript, and performance-first rendering strategies.
|
|
6
|
+
|
|
7
|
+
user-invokable: true
|
|
8
|
+
license: MIT
|
|
9
|
+
metadata:
|
|
10
|
+
author: lgzarturo
|
|
11
|
+
category: frontend
|
|
12
|
+
|
|
13
|
+
compatibility:
|
|
14
|
+
tools: [claude, codex, gemini, agy, opencode]
|
|
15
|
+
stacks:
|
|
16
|
+
languages: []
|
|
17
|
+
frameworks: []
|
|
18
|
+
|
|
19
|
+
risk:
|
|
20
|
+
level: low
|
|
21
|
+
can_execute_shell: false
|
|
22
|
+
can_modify_files: true
|
|
23
|
+
requires_network: false
|
|
24
|
+
|
|
25
|
+
inputs: []
|
|
26
|
+
|
|
27
|
+
outputs: []
|
|
28
|
+
|
|
29
|
+
quality:
|
|
30
|
+
reviewed_by: codeconductor-core
|
|
31
|
+
version: 0.1.0
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# Astro
|
|
37
|
+
|
|
38
|
+
## Islands Architecture
|
|
39
|
+
|
|
40
|
+
Astro renders everything to static HTML by default. JavaScript ships only for
|
|
41
|
+
components that explicitly opt in — these are called Islands.
|
|
42
|
+
|
|
43
|
+
### Hydration Directives
|
|
44
|
+
|
|
45
|
+
| Directive | When JS loads | Use case |
|
|
46
|
+
|-----------|--------------|----------|
|
|
47
|
+
| `client:load` | On page load | Interactive above-the-fold UI |
|
|
48
|
+
| `client:idle` | When browser is idle | Non-critical interactive widgets |
|
|
49
|
+
| `client:visible` | When element enters viewport | Below-the-fold islands |
|
|
50
|
+
| `client:media` | When CSS media query matches | Responsive interactive components |
|
|
51
|
+
| `client:only` | Client-only, no SSR | Components that require the DOM (e.g., charting libs) |
|
|
52
|
+
|
|
53
|
+
```astro
|
|
54
|
+
---
|
|
55
|
+
import Counter from '../components/Counter.tsx';
|
|
56
|
+
import HeavyChart from '../components/HeavyChart.tsx';
|
|
57
|
+
import MobileNav from '../components/MobileNav.tsx';
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
<!-- Hydrates immediately — user interacts right away -->
|
|
61
|
+
<Counter client:load />
|
|
62
|
+
|
|
63
|
+
<!-- Hydrates when scrolled into view — saves initial JS -->
|
|
64
|
+
<HeavyChart client:visible />
|
|
65
|
+
|
|
66
|
+
<!-- Only on mobile, only when query matches -->
|
|
67
|
+
<MobileNav client:media="(max-width: 768px)" />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Rules:
|
|
71
|
+
|
|
72
|
+
- Default to no hydration directive — most UI does not need JavaScript
|
|
73
|
+
- `client:load` is the most expensive directive; use it sparingly
|
|
74
|
+
- `client:only` skips server rendering entirely — the component receives no
|
|
75
|
+
props from the server; pass all data via props or fetch inside the component
|
|
76
|
+
- Do not use `client:load` for components that could use `client:visible`
|
|
77
|
+
|
|
78
|
+
### Framework Components Inside Astro
|
|
79
|
+
|
|
80
|
+
```astro
|
|
81
|
+
---
|
|
82
|
+
import ReactButton from './Button.tsx'; // React island
|
|
83
|
+
import VueWidget from './Widget.vue'; // Vue island
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
<!-- Both can coexist on the same page -->
|
|
87
|
+
<ReactButton client:idle label="Click me" />
|
|
88
|
+
<VueWidget client:visible />
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Each framework ships its own runtime only when at least one island of that
|
|
92
|
+
framework is on the page.
|
|
93
|
+
|
|
94
|
+
## Content Collections
|
|
95
|
+
|
|
96
|
+
Content Collections provide type-safe access to Markdown, MDX, and data files.
|
|
97
|
+
Define schemas in `src/content/config.ts`.
|
|
98
|
+
|
|
99
|
+
### Schema Definition
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// src/content/config.ts
|
|
103
|
+
import { defineCollection, z } from 'astro:content';
|
|
104
|
+
|
|
105
|
+
const blog = defineCollection({
|
|
106
|
+
type: 'content', // .md or .mdx files
|
|
107
|
+
schema: z.object({
|
|
108
|
+
title: z.string(),
|
|
109
|
+
description: z.string(),
|
|
110
|
+
pubDate: z.coerce.date(),
|
|
111
|
+
updatedDate: z.coerce.date().optional(),
|
|
112
|
+
author: z.string().default('Anonymous'),
|
|
113
|
+
tags: z.array(z.string()).default([]),
|
|
114
|
+
draft: z.boolean().default(false),
|
|
115
|
+
image: z.object({
|
|
116
|
+
src: z.string(),
|
|
117
|
+
alt: z.string(),
|
|
118
|
+
}).optional(),
|
|
119
|
+
}),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const docs = defineCollection({
|
|
123
|
+
type: 'content',
|
|
124
|
+
schema: z.object({
|
|
125
|
+
title: z.string(),
|
|
126
|
+
order: z.number(),
|
|
127
|
+
section: z.enum(['guide', 'reference', 'tutorial']),
|
|
128
|
+
}),
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const collections = { blog, docs };
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Querying Collections
|
|
135
|
+
|
|
136
|
+
```astro
|
|
137
|
+
---
|
|
138
|
+
import { getCollection, getEntry } from 'astro:content';
|
|
139
|
+
|
|
140
|
+
// All published posts, sorted by date
|
|
141
|
+
const posts = (await getCollection('blog', ({ data }) => !data.draft))
|
|
142
|
+
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
|
143
|
+
|
|
144
|
+
// Single entry by slug
|
|
145
|
+
const post = await getEntry('blog', 'my-first-post');
|
|
146
|
+
const { Content } = await post.render();
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
{posts.map(post => (
|
|
150
|
+
<article>
|
|
151
|
+
<h2><a href={`/blog/${post.slug}`}>{post.data.title}</a></h2>
|
|
152
|
+
<time>{post.data.pubDate.toLocaleDateString()}</time>
|
|
153
|
+
</article>
|
|
154
|
+
))}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Dynamic Routes from Collections
|
|
158
|
+
|
|
159
|
+
```astro
|
|
160
|
+
---
|
|
161
|
+
// src/pages/blog/[slug].astro
|
|
162
|
+
import { getCollection } from 'astro:content';
|
|
163
|
+
|
|
164
|
+
export async function getStaticPaths() {
|
|
165
|
+
const posts = await getCollection('blog');
|
|
166
|
+
return posts.map(post => ({
|
|
167
|
+
params: { slug: post.slug },
|
|
168
|
+
props: { post },
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const { post } = Astro.props;
|
|
173
|
+
const { Content, headings } = await post.render();
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
<article>
|
|
177
|
+
<h1>{post.data.title}</h1>
|
|
178
|
+
<Content />
|
|
179
|
+
</article>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Rendering Strategies
|
|
183
|
+
|
|
184
|
+
### SSG (Static Site Generation) — default
|
|
185
|
+
|
|
186
|
+
Every page is pre-rendered at build time. Best for content that does not change
|
|
187
|
+
per request.
|
|
188
|
+
|
|
189
|
+
```javascript
|
|
190
|
+
// astro.config.mjs — no output config needed; SSG is the default
|
|
191
|
+
export default defineConfig({
|
|
192
|
+
site: 'https://example.com',
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### SSR (Server-Side Rendering)
|
|
197
|
+
|
|
198
|
+
Renders pages on each request. Required for: authenticated routes, personalized
|
|
199
|
+
content, live data.
|
|
200
|
+
|
|
201
|
+
```javascript
|
|
202
|
+
// astro.config.mjs
|
|
203
|
+
import node from '@astrojs/node';
|
|
204
|
+
|
|
205
|
+
export default defineConfig({
|
|
206
|
+
output: 'server',
|
|
207
|
+
adapter: node({ mode: 'standalone' }),
|
|
208
|
+
});
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Hybrid Mode
|
|
212
|
+
|
|
213
|
+
Mix SSG and SSR on a per-page basis. Most pages are static; specific routes opt
|
|
214
|
+
into server rendering.
|
|
215
|
+
|
|
216
|
+
```javascript
|
|
217
|
+
// astro.config.mjs
|
|
218
|
+
export default defineConfig({
|
|
219
|
+
output: 'hybrid',
|
|
220
|
+
adapter: node({ mode: 'standalone' }),
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
```astro
|
|
225
|
+
---
|
|
226
|
+
// src/pages/dashboard.astro — this page is server-rendered
|
|
227
|
+
export const prerender = false;
|
|
228
|
+
|
|
229
|
+
// src/pages/about.astro — this page is statically generated (hybrid default)
|
|
230
|
+
export const prerender = true;
|
|
231
|
+
---
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Use hybrid mode when: most content is static but a few routes need auth or
|
|
235
|
+
live data. Do not make everything `output: 'server'` — you lose the performance
|
|
236
|
+
benefits of static generation.
|
|
237
|
+
|
|
238
|
+
## Image Optimization
|
|
239
|
+
|
|
240
|
+
Use the built-in `<Image>` and `<Picture>` components. Never use raw `<img>`
|
|
241
|
+
for local assets — you lose automatic optimization.
|
|
242
|
+
|
|
243
|
+
```astro
|
|
244
|
+
---
|
|
245
|
+
import { Image, Picture } from 'astro:assets';
|
|
246
|
+
import heroImage from '../assets/hero.png';
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
<!-- Optimized single image -->
|
|
250
|
+
<Image
|
|
251
|
+
src={heroImage}
|
|
252
|
+
alt="Hero illustration"
|
|
253
|
+
width={800}
|
|
254
|
+
height={600}
|
|
255
|
+
format="webp"
|
|
256
|
+
quality={80}
|
|
257
|
+
/>
|
|
258
|
+
|
|
259
|
+
<!-- Responsive with multiple formats -->
|
|
260
|
+
<Picture
|
|
261
|
+
src={heroImage}
|
|
262
|
+
formats={['avif', 'webp']}
|
|
263
|
+
alt="Hero illustration"
|
|
264
|
+
widths={[400, 800, 1200]}
|
|
265
|
+
sizes="(max-width: 800px) 100vw, 800px"
|
|
266
|
+
/>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Rules:
|
|
270
|
+
|
|
271
|
+
- Always provide `alt` — empty string is acceptable only for decorative images
|
|
272
|
+
- Prefer `avif` + `webp` fallback for best compression
|
|
273
|
+
- Use `widths` + `sizes` on above-the-fold images to serve the right size per
|
|
274
|
+
viewport
|
|
275
|
+
- Remote images require explicit `width` and `height` to prevent layout shift
|
|
276
|
+
|
|
277
|
+
## Project Structure
|
|
278
|
+
|
|
279
|
+
```text
|
|
280
|
+
src/
|
|
281
|
+
assets/ — images and static assets processed by Astro
|
|
282
|
+
components/ — .astro components (and framework islands)
|
|
283
|
+
content/
|
|
284
|
+
blog/ — .md and .mdx files
|
|
285
|
+
config.ts — collection schemas
|
|
286
|
+
layouts/ — page shell layouts
|
|
287
|
+
pages/ — file-based routing; every file is a route
|
|
288
|
+
styles/ — global CSS
|
|
289
|
+
astro.config.mjs
|
|
290
|
+
tsconfig.json
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Colocation rule: put framework island components (`.tsx`, `.vue`) in
|
|
294
|
+
`src/components/`. Do not scatter them in `src/pages/`.
|
|
295
|
+
|
|
296
|
+
## TypeScript Conventions
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
// tsconfig.json — use the strict Astro preset
|
|
300
|
+
{
|
|
301
|
+
"extends": "astro/tsconfigs/strict"
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
```astro
|
|
306
|
+
---
|
|
307
|
+
// Type props explicitly in the frontmatter
|
|
308
|
+
interface Props {
|
|
309
|
+
title: string;
|
|
310
|
+
description?: string;
|
|
311
|
+
tags: string[];
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const { title, description = '', tags } = Astro.props;
|
|
315
|
+
---
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Astro infers prop types from `interface Props` automatically. Do not use `any`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: auth-token-inspector
|
|
3
|
+
name: auth-token-inspector
|
|
4
|
+
description: >
|
|
5
|
+
Audits token storage mechanisms to prevent XSS-based JWT theft.
|
|
6
|
+
user-invokable: true
|
|
7
|
+
license: MIT
|
|
8
|
+
metadata:
|
|
9
|
+
author: lgzarturo
|
|
10
|
+
category: security
|
|
11
|
+
compatibility:
|
|
12
|
+
tools: [claude, codex, gemini, agy, opencode]
|
|
13
|
+
stacks:
|
|
14
|
+
languages: [typescript, javascript, python, kotlin, java, php]
|
|
15
|
+
---
|
|
16
|
+
# Auth Token Inspector
|
|
17
|
+
|
|
18
|
+
## Core Principles
|
|
19
|
+
|
|
20
|
+
1. **Secure Storage**: JWTs or session tokens must NOT be stored in `localStorage` or `sessionStorage` due to vulnerability to Cross-Site Scripting (XSS).
|
|
21
|
+
2. **HttpOnly Cookies**: Deliver tokens via `HttpOnly`, `Secure`, and `SameSite=Strict` (or `Lax`) cookies to protect them from client-side JS access.
|
|
22
|
+
3. **Short Expiration**: Ensure access tokens have short expiration times, and implement secure, rotation-enabled refresh tokens stored in cookies.
|
|
23
|
+
|
|
24
|
+
## Storage Comparison
|
|
25
|
+
|
|
26
|
+
| Storage Mode | Vulnerable to XSS | Vulnerable to CSRF | Recommended |
|
|
27
|
+
| :--- | :--- | :--- | :--- |
|
|
28
|
+
| **localStorage** | Yes (High Risk) | No | **NO** |
|
|
29
|
+
| **sessionStorage** | Yes (High Risk) | No | **NO** |
|
|
30
|
+
| **HttpOnly Cookie** | No (Secure) | Yes (Mitigated via SameSite/Tokens) | **YES** |
|
|
@@ -34,7 +34,9 @@ errors instead of pasting dumps. If unresolved credential material remains, stop
|
|
|
34
34
|
and wait for a human (CCEP `stopOnHighRisk`).
|
|
35
35
|
|
|
36
36
|
Include: goal, Task Card status (no secret fields), files touched, test
|
|
37
|
-
pass/fail (not log dumps), open questions,
|
|
37
|
+
pass/fail (not log dumps), open questions, the next `$cc-` command, plus links
|
|
38
|
+
to the Delivery Ledger and verification evidence when they exist. Do not repeat
|
|
39
|
+
the original request or transcript.
|
|
38
40
|
|
|
39
41
|
Do not edit source or tests.
|
|
40
42
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cc-odd
|
|
3
|
+
description: Create or resume an opt-in Delivery Ledger for substantial authorized work.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# odd
|
|
7
|
+
|
|
8
|
+
Invoke as `$cc-odd`. The user request follows the skill mention.
|
|
9
|
+
|
|
10
|
+
# /cc:odd
|
|
11
|
+
|
|
12
|
+
## Step 0 — CCEP Bootstrap
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bun run dev ccep parse --command odd "$ARGUMENTS"
|
|
16
|
+
bun run dev ccep resolve --command odd "$ARGUMENTS"
|
|
17
|
+
bun run dev ccep profile --command odd
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Create a ledger only after authorization and tracked coordination. Read-only and small work do not create state.
|
|
21
|
+
|
|
22
|
+
When ODD has verification evidence, include its RDD receipt in the ledger
|
|
23
|
+
handoff. On resume, verify it against the workspace before relying on a prior
|
|
24
|
+
test or review result. If it is stale, keep the ledger and repeat only the
|
|
25
|
+
invalidated verification.
|
|
@@ -138,6 +138,10 @@ npx cc-codeconductor openspec archive <itemId>
|
|
|
138
138
|
|
|
139
139
|
`start` moves the card `pending → doing` and the item `PLANNED → IN_PROGRESS`. `done` marks the card complete, updates Progress, and moves the item to `REVIEW` when every card is done and review is required. `archive` requires all cards done (and review evidence when Global review is required) and moves `openspec/changes/<slug>` to `archive/`.
|
|
140
140
|
|
|
141
|
+
For test and implementation cards, `done` also requires a current RDD-backed
|
|
142
|
+
RED or GREEN receipt respectively. Do not reuse evidence after candidate files
|
|
143
|
+
change; capture and verify the matching receipt again.
|
|
144
|
+
|
|
141
145
|
---
|
|
142
146
|
|
|
143
147
|
## Step 5 — Model matrix and execute loop
|
|
@@ -210,4 +214,4 @@ Report completion: Task Cards executed, scorecard verdict, change folder path, f
|
|
|
210
214
|
|
|
211
215
|
## Skill
|
|
212
216
|
|
|
213
|
-
Apply `.
|
|
217
|
+
Apply `.codex/skills/openspec/SKILL.md` for backlog format rules and state transitions.
|
|
@@ -72,9 +72,8 @@ the following steps in order:
|
|
|
72
72
|
the output filename: `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
|
|
73
73
|
|
|
74
74
|
2. **Collect** — Call the PageSpeed Insights API for the requested strategy
|
|
75
|
-
(`mobile`, `desktop`, or `both`)
|
|
76
|
-
|
|
77
|
-
Otherwise, use `WebFetch` to call the PSI endpoint directly.
|
|
75
|
+
(`mobile`, `desktop`, or `both`) using `WebFetch` to call the PSI endpoint
|
|
76
|
+
directly.
|
|
78
77
|
|
|
79
78
|
3. **Analyze** — Extract Core Web Vitals (LCP, INP, CLS, FCP, TTFB, TBT),
|
|
80
79
|
identify the LCP element, enumerate third-party scripts by blocking time,
|
|
@@ -116,6 +116,37 @@ Evaluate the diff against the following checklist:
|
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
119
|
+
## Severity Rubric
|
|
120
|
+
|
|
121
|
+
Classify every finding using these concrete anchors — not general judgment —
|
|
122
|
+
so the same finding gets the same category on any run.
|
|
123
|
+
|
|
124
|
+
**CRITICAL** (always):
|
|
125
|
+
|
|
126
|
+
- Unauthenticated access to a protected resource
|
|
127
|
+
- Injection (SQL, command, XSS) reachable from untrusted input
|
|
128
|
+
- A secret or credential present in the diff
|
|
129
|
+
- A destructive operation with no confirmation
|
|
130
|
+
- The build or test suite is broken
|
|
131
|
+
- A direct contradiction of an explicit acceptance criterion
|
|
132
|
+
|
|
133
|
+
**WARNING**:
|
|
134
|
+
|
|
135
|
+
- Missing test for a new branch or edge case
|
|
136
|
+
- An error is silently swallowed — no log, no propagation
|
|
137
|
+
- A change outside the declared scope
|
|
138
|
+
- Inconsistent with an established pattern already in the module
|
|
139
|
+
- Missing input validation in an internal function (not exposed at a trust boundary)
|
|
140
|
+
|
|
141
|
+
**SUGGESTION**:
|
|
142
|
+
|
|
143
|
+
- Style or naming
|
|
144
|
+
- Minor readability
|
|
145
|
+
- Speculative refactor that wasn't requested
|
|
146
|
+
- Non-blocking micro-optimization
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
119
150
|
## Step 3 — Review Report
|
|
120
151
|
|
|
121
152
|
Produce a structured Review Report with findings in three categories:
|
|
@@ -65,7 +65,7 @@ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
|
|
|
65
65
|
`graphify path` / `graphify explain` when needed). Then invoke `repo-explorer`
|
|
66
66
|
to map modules, conventions, and impact radius. Do not write code in this step.
|
|
67
67
|
Record a Repo Map artifact before intake. Load the matching `security-*` skill
|
|
68
|
-
for the named domain (see `.
|
|
68
|
+
for the named domain (see `.codex/skills/security-*/SKILL.md`). Keep the OWASP
|
|
69
69
|
`security` skill for application-security reviews.
|
|
70
70
|
|
|
71
71
|
---
|
|
@@ -131,6 +131,11 @@ Verdict is binary: PASS continues to the mutation gate; REJECT returns to the
|
|
|
131
131
|
|
|
132
132
|
## Stage 5 — Mutation gate (`mutation_testing`)
|
|
133
133
|
|
|
134
|
+
RDD complements this gate: capture the candidate receipt before Mutation Testing
|
|
135
|
+
and verify it after the runner restores production source. A survivor opens a
|
|
136
|
+
new tester/reviewer-approved test revision; it never makes an earlier receipt
|
|
137
|
+
valid again.
|
|
138
|
+
|
|
134
139
|
Run the deterministic AST mutator shipped with this preset:
|
|
135
140
|
|
|
136
141
|
```bash
|
|
@@ -70,6 +70,14 @@ runner) — do not hand-edit JSON under `.codeconductor/evidence/`.
|
|
|
70
70
|
|
|
71
71
|
Do not advance phases until that evidence exists.
|
|
72
72
|
|
|
73
|
+
### Receipt-Driven Development
|
|
74
|
+
|
|
75
|
+
Run the verification runner with the matching `phase` (`red`, `green`, or
|
|
76
|
+
`refactor`). It records an RDD receipt for the complete candidate. Before a
|
|
77
|
+
handoff, phase transition, or final review, verify that receipt. A changed
|
|
78
|
+
source, test, contract, lockfile, or runner configuration invalidates it and
|
|
79
|
+
requires the affected phase to run again.
|
|
80
|
+
|
|
73
81
|
---
|
|
74
82
|
|
|
75
83
|
## Phase 1 — RED (Tester role)
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: code-review
|
|
3
|
+
name: code-review
|
|
4
|
+
description: >
|
|
5
|
+
Provides a structured framework for conducting thorough code reviews covering correctness, security, architecture alignment, performance, and technical debt.
|
|
6
|
+
|
|
7
|
+
user-invokable: true
|
|
8
|
+
license: MIT
|
|
9
|
+
metadata:
|
|
10
|
+
author: lgzarturo
|
|
11
|
+
category: review
|
|
12
|
+
|
|
13
|
+
compatibility:
|
|
14
|
+
tools: [claude, codex, gemini, agy, opencode]
|
|
15
|
+
stacks:
|
|
16
|
+
languages: []
|
|
17
|
+
frameworks: []
|
|
18
|
+
|
|
19
|
+
risk:
|
|
20
|
+
level: low
|
|
21
|
+
can_execute_shell: false
|
|
22
|
+
can_modify_files: true
|
|
23
|
+
requires_network: false
|
|
24
|
+
|
|
25
|
+
inputs: []
|
|
26
|
+
|
|
27
|
+
outputs: []
|
|
28
|
+
|
|
29
|
+
quality:
|
|
30
|
+
reviewed_by: codeconductor-core
|
|
31
|
+
version: 0.1.0
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# Code Review
|
|
37
|
+
|
|
38
|
+
## Review Axes
|
|
39
|
+
|
|
40
|
+
Every finding must reference exactly one axis. This prevents vague feedback and
|
|
41
|
+
makes it actionable.
|
|
42
|
+
|
|
43
|
+
| Axis | What to check |
|
|
44
|
+
|------|--------------|
|
|
45
|
+
| **Correctness** | Does the logic handle all cases in the acceptance criteria? |
|
|
46
|
+
| **Security** | Injection vectors, secret exposure, auth bypasses, insecure defaults |
|
|
47
|
+
| **Architecture** | Does the code follow existing patterns and module boundaries? |
|
|
48
|
+
| **Performance** | N+1 queries, unnecessary allocations, blocking I/O in hot paths |
|
|
49
|
+
| **Error handling** | Are failure cases handled explicitly and safely? |
|
|
50
|
+
| **Test coverage** | Do tests verify the acceptance criteria, not just happy paths? |
|
|
51
|
+
| **Scope** | Are there changes outside the stated task boundary? |
|
|
52
|
+
| **Technical debt** | Does the implementation introduce debt without acknowledging it? |
|
|
53
|
+
|
|
54
|
+
## Finding Categories
|
|
55
|
+
|
|
56
|
+
### CRITICAL — must be resolved before merge
|
|
57
|
+
|
|
58
|
+
- Logic failures that violate acceptance criteria
|
|
59
|
+
- Security vulnerabilities (injection, auth bypass, secret exposure)
|
|
60
|
+
- Data loss or corruption risk
|
|
61
|
+
- Breaking changes to public API or shared contracts
|
|
62
|
+
- Missing error handling that causes silent failures
|
|
63
|
+
|
|
64
|
+
### WARNING — should be resolved before merge
|
|
65
|
+
|
|
66
|
+
- Missing edge case coverage in tests
|
|
67
|
+
- Scope creep (changes outside the task boundary)
|
|
68
|
+
- Pattern inconsistency that will confuse future maintainers
|
|
69
|
+
- Performance issue that will degrade under load
|
|
70
|
+
- Missing input validation at system boundaries
|
|
71
|
+
|
|
72
|
+
### SUGGESTION — optional improvement
|
|
73
|
+
|
|
74
|
+
- Naming clarity improvements
|
|
75
|
+
- Extracting a reusable abstraction
|
|
76
|
+
- Test readability
|
|
77
|
+
- Documentation gaps on non-obvious behavior
|
|
78
|
+
|
|
79
|
+
## Review Report Format
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
## Review Report
|
|
83
|
+
|
|
84
|
+
**Task**: [objective from task card]
|
|
85
|
+
**Verdict**: [approved | approved with warnings | blocked]
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### CRITICAL
|
|
90
|
+
|
|
91
|
+
- [ ] [C1] `path/to/file:line` — [description]
|
|
92
|
+
Axis: [axis] | Evidence: `[quoted code]` | Required action: [what must change]
|
|
93
|
+
|
|
94
|
+
_(none)_ if no critical findings
|
|
95
|
+
|
|
96
|
+
### WARNING
|
|
97
|
+
|
|
98
|
+
- [ ] [W1] `path/to/file:line` — [description]
|
|
99
|
+
Axis: [axis] | Recommended action: [what should change]
|
|
100
|
+
|
|
101
|
+
_(none)_ if no warning findings
|
|
102
|
+
|
|
103
|
+
### SUGGESTION
|
|
104
|
+
|
|
105
|
+
- [ ] [S1] — [description] | Rationale: [brief reason]
|
|
106
|
+
|
|
107
|
+
_(none)_ if no suggestions
|
|
108
|
+
|
|
109
|
+
### Summary
|
|
110
|
+
|
|
111
|
+
- Critical: [count] | Warning: [count] | Suggestion: [count]
|
|
112
|
+
- **Verdict justification**: [one sentence]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Verdict rules:**
|
|
116
|
+
|
|
117
|
+
- `blocked` — any CRITICAL finding present
|
|
118
|
+
- `approved with warnings` — no CRITICAL, at least one WARNING
|
|
119
|
+
- `approved` — no CRITICAL, no WARNING
|
|
120
|
+
|
|
121
|
+
## What to Check — by Axis
|
|
122
|
+
|
|
123
|
+
### Correctness
|
|
124
|
+
|
|
125
|
+
- Does every acceptance criterion have a corresponding code path?
|
|
126
|
+
- Are null/empty/zero values handled explicitly?
|
|
127
|
+
- Are boundary conditions checked (off-by-one, empty collections, max values)?
|
|
128
|
+
- Do conditional branches cover all cases (exhaustive when/switch)?
|
|
129
|
+
|
|
130
|
+
### Security
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Injection: SQL, command, LDAP, XML — is input sanitized or parameterized?
|
|
134
|
+
Auth: is the endpoint protected? are role checks correct?
|
|
135
|
+
Secrets: no hardcoded credentials, tokens, or keys in source
|
|
136
|
+
Headers: are security headers set (CSP, HSTS, X-Frame-Options)?
|
|
137
|
+
CORS: is the origin whitelist explicit, not wildcard?
|
|
138
|
+
Dependencies: are new dependencies from trusted sources?
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Performance
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
N+1 queries: does a loop call the database per iteration?
|
|
145
|
+
Eager loading: are JOINs or includes used where needed?
|
|
146
|
+
Pagination: are all list endpoints paginated?
|
|
147
|
+
Caching: is expensive computation cached at an appropriate layer?
|
|
148
|
+
Index: do new query filters have corresponding DB indexes?
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Error Handling
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
Are exceptions caught at the right layer (not swallowed silently)?
|
|
155
|
+
Is the error response format consistent with the rest of the API?
|
|
156
|
+
Is the original exception logged before translating to a user-facing error?
|
|
157
|
+
Are transient failures retried with backoff, or propagated immediately?
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## What NOT to Flag
|
|
161
|
+
|
|
162
|
+
**Personal style preferences.** If the code follows the project's established
|
|
163
|
+
conventions, do not flag it because you would have written it differently.
|
|
164
|
+
|
|
165
|
+
**Trivial naming.** Variable names are a SUGGESTION at most, never a WARNING.
|
|
166
|
+
Do not block a PR over naming unless the name is genuinely misleading.
|
|
167
|
+
|
|
168
|
+
**Tests for trivial code.** Do not demand tests for getters, setters, or data
|
|
169
|
+
class construction. Test behavior, not boilerplate.
|
|
170
|
+
|
|
171
|
+
**Refactors not in scope.** If you notice an improvement opportunity outside
|
|
172
|
+
the task boundary, log it as a SUGGESTION. Do not block the PR for work that
|
|
173
|
+
was not requested.
|
|
174
|
+
|
|
175
|
+
**Framework defaults.** Do not second-guess framework conventions (Spring
|
|
176
|
+
dependency injection, Next.js file-based routing). Trust the framework.
|
|
177
|
+
|
|
178
|
+
## Exact Diff Recommendations
|
|
179
|
+
|
|
180
|
+
When a finding requires a code change, provide the exact replacement:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
# Current code (path/to/file:42)
|
|
184
|
+
val user = userRepository.findById(id)
|
|
185
|
+
return user.name // NPE if not found
|
|
186
|
+
|
|
187
|
+
# Recommended fix
|
|
188
|
+
val user = userRepository.findById(id)
|
|
189
|
+
?: throw NotFoundException("User $id not found")
|
|
190
|
+
return user.name
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Vague instructions ("handle the null case") force the author to guess your
|
|
194
|
+
intent. Exact diffs remove ambiguity and speed up the review cycle.
|
|
195
|
+
|
|
196
|
+
## Prioritization Order
|
|
197
|
+
|
|
198
|
+
When multiple findings exist, address them in this order:
|
|
199
|
+
|
|
200
|
+
1. Security — security issues can silently compromise users or data
|
|
201
|
+
2. Correctness — broken behavior defeats the purpose of the change
|
|
202
|
+
3. Error handling — silent failures are hard to debug in production
|
|
203
|
+
4. Test coverage — gaps mean regressions will be invisible
|
|
204
|
+
5. Performance — degrade gradually; fix before it causes incidents
|
|
205
|
+
6. Architecture — inconsistency compounds over time
|
|
206
|
+
7. Technical debt — acknowledge and track; do not always block for it
|
|
207
|
+
8. Suggestions — apply at author's discretion
|