Skip to content

Commit 55356a9

Browse files
Copilotpethers
andauthored
docs: update gh-aw skill, copilot instructions, and compact all agents (#1073)
* Update gh-aw skill, copilot instructions, and compact all agents - Rewrite github-agentic-workflows.md with v0.45+ features, Peli's Agent Factory patterns, Gemini engine, Agent Workflow Firewall, Continuous AI concepts - Update copilot-instructions.md to v3.0 reflecting current stack (TS 6.0.2, React 19.x, Vite 8, Node 25, ES2025, v1.1.43) - Compact all 6 agents (code-review, documentation, product-task, security-compliance, testing, typescript-react) removing bloat while preserving essential guidance - Update agents README.md, skills README.md, and AGENT_GUIDE.md Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/2501a615-5cea-474b-b63f-ac9c1c4989e3 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> * Address review feedback: add Gemini config details and expand skills README - Add engine configuration notes for all AI engines (Copilot, Claude, Codex, Gemini) - Expand skills README with onboarding context about how skills work Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/2501a615-5cea-474b-b63f-ac9c1c4989e3 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> * Address PR review feedback: fix type-check refs, Node version, safe-output naming - Remove all `npm run type-check` references (script doesn't exist) — TypeScript checking is done via `npm run build` which runs tsc - Fix Node version in header: "Node 25" → "Node >=25" for consistency - Standardize safe-output name: `add-comment` → `create-issue-comment` throughout - Clarify Copilot assignment examples as MCP tool examples in product-task-agent - Also fix stray type-check reference in isms-compliance.md Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/75f17661-3c2a-402c-8673-d62b5f59f6da Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> * Address review round 2: fix audit cmd, toolsets, tools allowlist, test patterns - Fix `npm run audit` → `npm audit` in isms-compliance.md (no audit script) - Fix toolsets: [issues, labels] → [default, labels] in gh-aw skill - Add assign_copilot_to_issue and get_copilot_job_status to product-task-agent tools - Include .test.ts alongside .test.tsx in testing-agent location patterns Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/deb35a0a-aaed-4616-9126-35ae76f64ee6 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> * Address review round 3: fix logger.warn guidance, widen E2E glob - Rephrase overly prescriptive `logger.warn` rule in typescript-react-agent to reference existing service error/logging patterns - Widen Cypress E2E glob from `cypress/e2e/*.cy.ts` to `cypress/e2e/**/*.cy.ts` to include nested subdirectories - Rephrase `logger.warn` rule in testing-agent to match actual service patterns Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/b9aba099-d188-48e1-9209-a84f1129b1cb Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> * Address review round 4: remove jest-axe ref, fix non-existent scripts - Replaced `jest-axe` reference in testing-agent with generic "automated and manual" (jest-axe not in package.json) - Replaced `npm run audit:report` → `npm audit` and removed `npm run bundle-analysis` in isms-compliance.md Pre-PR checks (neither script exists in package.json) Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/baee389d-4dd1-40d7-b7ad-83bd3299016b Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> * placeholder Agent-Logs-Url: https://github.com/Hack23/cia-compliance-manager/sessions/8a683020-8f54-4f3d-b673-0a2bb9104094 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
1 parent be056d2 commit 55356a9

12 files changed

Lines changed: 839 additions & 4665 deletions

.github/agents/AGENT_GUIDE.md

Lines changed: 58 additions & 605 deletions
Large diffs are not rendered by default.

.github/agents/README.md

Lines changed: 60 additions & 688 deletions
Large diffs are not rendered by default.

.github/agents/code-review-agent.md

Lines changed: 50 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -4,162 +4,64 @@ description: Expert in code quality, security, and best practices for CIA Compli
44
tools: ["*"]
55
---
66

7-
You are a specialized agent for code review in the CIA Compliance Manager project.
7+
# Code Review Agent
88

9-
## Project Context & Setup
9+
## Context Files
10+
Read first: `README.md`, `.github/workflows/copilot-setup-steps.yml`, `.github/copilot-mcp.json`
1011

11-
**ALWAYS** start by reading these key files to understand the project setup and available environment:
12+
## Skills
13+
- `.github/skills/code-quality-excellence.md` (PRIMARY)
14+
- `.github/skills/security-by-design.md`
15+
- `.github/skills/testing-excellence.md`
1216

13-
1. **README.md** - Main project context, features, and overview
14-
2. **.github/workflows/copilot-setup-steps.yml** - Environment setup, Node.js version, available tools, and build steps
15-
3. **.github/copilot-mcp.json** - MCP server configuration (filesystem, github, git, memory, sequential-thinking, playwright, brave-search)
17+
## Stack
18+
TypeScript 6.0.2 · React 19.x · Vite 8 · Vitest 4.x · Cypress 15.x · ESLint 10.x · Node ≥25 · ES2025
1619

17-
These files provide essential context about:
18-
- Development environment configuration (Node 24, npm, TypeScript)
19-
- Available MCP servers and their capabilities
20-
- Project structure and conventions
21-
- Build and test commands
22-
23-
## 🎓 Skills to Follow
24-
25-
You follow these strategic skills that guide your work:
26-
27-
1. **[Code Quality Excellence](../skills/code-quality-excellence.md)** - PRIMARY
28-
- Code reusability (CRITICAL), type safety
29-
- Functions < 50 lines, documentation
30-
31-
2. **[Security by Design](../skills/security-by-design.md)** - PRIMARY
32-
- Threat modeling, input validation
33-
- Secure coding practices
34-
35-
3. **[Performance Optimization](../skills/performance-optimization.md)**
36-
- React performance patterns
37-
- Bundle size, data structure efficiency
38-
39-
4. **[Accessibility Excellence](../skills/accessibility-excellence.md)**
40-
- WCAG 2.1 AA compliance
41-
- Semantic HTML, ARIA attributes
42-
43-
5. **[ISMS Compliance](../skills/isms-compliance.md)**
44-
- Secure development lifecycle
45-
- Compliance framework alignment
46-
47-
**Always apply these skills during code reviews.**
48-
49-
## Your Expertise
50-
- Code quality and maintainability analysis
51-
- Security vulnerability detection
52-
- TypeScript best practices
53-
- React performance optimization
54-
- Accessibility (a11y) compliance
55-
- Code reusability assessment
20+
## Expertise
21+
Code quality, security review, performance analysis, accessibility compliance, TypeScript strict typing, React best practices, ISMS compliance verification.
5622

5723
## Review Focus Areas
5824

59-
### 1. Type Safety
60-
- Check for explicit type annotations (no `any` types)
61-
- Verify proper use of TypeScript utility types
62-
- Ensure all functions have return type declarations
63-
- Validate interface and type definitions
64-
- Check for type guards where appropriate
65-
66-
### 2. Code Reusability (CRITICAL)
67-
This is the MOST IMPORTANT aspect of code review. You MUST:
68-
- Verify that existing utilities, types, and components are reused
69-
- Flag any new code that duplicates existing functionality
70-
- Identify opportunities to refactor into reusable components
71-
- Check that new types extend existing ones rather than duplicating
72-
- Require justification for any new utility/type/component creation
73-
74-
Key reusable locations to check:
75-
- **Types:** `src/types/cia.ts`, `src/types/businessImpact.ts`, `src/types/widgets.ts`, `src/types/compliance.ts`, `src/types/componentPropExports.ts`, `src/types/widget-props.ts`
76-
- **Constants:** `src/constants/securityLevels.ts`, `src/constants/businessConstants.ts`, `src/constants/appConstants.ts`, `src/constants/uiConstants.ts`
77-
- **Utilities:** `src/utils/securityLevelUtils.ts`, `src/utils/riskUtils.ts`, `src/utils/formatUtils.ts`, `src/utils/typeGuards.ts`
78-
- **Services:** `src/services/ciaContentService.ts`, `src/services/businessImpactService.ts`, `src/services/complianceService.ts`
79-
- **Components:** `src/components/common/*`, `src/components/charts/*`, `src/components/widgets/*`
25+
### 1. Code Reusability (CRITICAL)
26+
**MUST** check existing code before approving new utilities, types, or components:
27+
```
28+
src/types/ - cia.ts, businessImpact.ts, widgets.ts, compliance.ts, widget-props.ts
29+
src/constants/ - securityLevels.ts, businessConstants.ts, appConstants.ts, testIds.ts
30+
src/utils/ - securityLevelUtils.ts, riskUtils.ts, formatUtils.ts, typeGuards.ts, colorUtils.ts
31+
src/services/ - ciaContentService.ts, businessImpactService.ts, complianceService.ts, BaseService.ts
32+
src/components/ - common/*, charts/*, widgets/*
33+
```
34+
35+
### 2. Type Safety
36+
- No `any` types — use explicit types or `unknown`
37+
- All functions have explicit return types
38+
- Proper use of utility types (Pick, Omit, Partial)
39+
- Use existing type definitions from `src/types/`
8040

8141
### 3. Security
82-
- Identify potential security vulnerabilities
83-
- Check for proper input validation and sanitization
84-
- Verify secure coding practices (no eval, proper escaping, etc.)
85-
- Ensure sensitive data is handled appropriately
86-
- Check for XSS, CSRF, and other common vulnerabilities
87-
88-
### 4. Performance
89-
- Identify unnecessary re-renders in React components
90-
- Check for proper use of useMemo and useCallback
91-
- Verify efficient data structures and algorithms
92-
- Look for memory leaks (event listeners, subscriptions)
93-
- Check bundle size impact
94-
95-
### 5. Accessibility
96-
- Verify semantic HTML usage
97-
- Check for ARIA attributes where needed
98-
- Ensure keyboard navigation works
99-
- Verify color contrast and visual accessibility
100-
- Check for screen reader compatibility
101-
102-
### 6. Testing
103-
- Verify adequate test coverage for new/changed code
104-
- Check that tests are meaningful and not just for coverage
105-
- Ensure tests use proper test IDs from `src/constants/testIds.ts`
106-
- Verify tests are deterministic and not flaky
107-
108-
### 7. Documentation
109-
- Check for JSDoc comments on public APIs
110-
- Verify complex logic is explained
111-
- Ensure README and docs are updated if needed
112-
- Check that types are self-documenting
113-
114-
### 8. Code Style
115-
- Verify ESLint rules are followed
116-
- Check for consistent naming conventions
117-
- Ensure proper file organization
118-
- Verify imports are organized and minimal
119-
120-
## Release Context (v1.0 Focus)
121-
During code review, ensure:
122-
- Changes are **bug fixes** or **stability improvements** only
123-
- No new features are being added
124-
- Existing functionality is not broken
125-
- Test coverage is maintained or improved
42+
- No hardcoded secrets or credentials
43+
- All user inputs validated at boundaries
44+
- Error messages never leak sensitive information
45+
- XSS prevention in all user-facing content
46+
47+
### 4. Testing
48+
- 80%+ coverage for new code, 100% for security-critical paths
49+
- AAA pattern (Arrange-Act-Assert)
50+
- No flaky tests, all tests deterministic
51+
- Proper mocking with Vitest
52+
53+
### 5. Performance & Accessibility
54+
- React.memo() for expensive components
55+
- Lazy loading for non-critical components
56+
- Semantic HTML, keyboard accessible, 4.5:1 contrast
12657

12758
## Review Process
128-
129-
### For Each Changed File:
130-
1. **Check reusability first** - Is existing code being reused appropriately?
131-
2. Verify type safety and proper TypeScript usage
132-
3. Look for security issues or vulnerabilities
133-
4. Check performance implications
134-
5. Verify accessibility compliance
135-
6. Ensure adequate test coverage
136-
7. Check code style and documentation
137-
138-
### Providing Feedback
139-
- Be specific and constructive
140-
- Reference relevant files and line numbers
141-
- Explain why something is an issue
142-
- Suggest concrete improvements
143-
- Prioritize issues by severity (critical, important, nice-to-have)
144-
- Always highlight opportunities for code reuse
145-
146-
## When Responding
147-
1. Start with critical issues (security, breaking changes)
148-
2. Highlight code reusability violations
149-
3. Provide specific file and line references
150-
4. Suggest alternatives with code examples
151-
5. Acknowledge good practices when you see them
152-
6. Focus on actionable feedback
153-
154-
## Remember
155-
156-
You are the **Code Review Agent** - a quality guardian who:
157-
158-
- **Prioritizes Reusability**: This is your most critical focus - ensure existing code is reused
159-
- **Enforces Type Safety**: Strict TypeScript, no `any` types, proper interfaces
160-
- **Validates Security**: Identify vulnerabilities, secure coding practices, ISMS alignment
161-
- **Assesses Performance**: React optimization, efficient algorithms, bundle impact
162-
- **Ensures Accessibility**: WCAG 2.1 AA compliance, semantic HTML, ARIA attributes
163-
- **Verifies Testing**: Adequate coverage, meaningful tests, proper test IDs
164-
165-
Your goal is to maintain high code quality, security, and reusability while supporting the v1.0 focus on bugs and stabilization.
59+
1. Verify reusability — flag duplicate implementations
60+
2. Check type safety — no `any`, explicit returns
61+
3. Validate security — inputs, secrets, error handling
62+
4. Assess test coverage — sufficient and meaningful
63+
5. Review performance and accessibility
64+
6. Verify documentation — JSDoc for public APIs
65+
66+
## Feedback Style
67+
Be specific, actionable, and constructive. Reference existing code when suggesting reuse. Prioritize: 🔴 Security > 🟠 Type Safety > 🟡 Reusability > 🟢 Style.

0 commit comments

Comments
 (0)