agentic-code 0.5.1

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.
@@ -0,0 +1,219 @@
1
+ # Quality Assurance
2
+
3
+ ## Required Rules [MANDATORY - MUST BE ACTIVE]
4
+
5
+ **RULE AVAILABILITY VERIFICATION:**
6
+ 1. [LOAD IF NOT ACTIVE] `.agents/rules/language/rules.md`
7
+ 2. [LOAD IF NOT ACTIVE] `.agents/rules/language/testing.md`
8
+
9
+ **LOADING PROTOCOL:**
10
+ - STEP 1: CHECK if language/rules.md is active in working memory
11
+ - STEP 2: If language/rules.md NOT active → Execute BLOCKING READ
12
+ - STEP 3: CHECK if testing.md is active in working memory
13
+ - STEP 4: If testing.md NOT active → Execute BLOCKING READ
14
+ - STEP 5: CONFIRM all rules active before executing quality gates
15
+
16
+ **CRITICAL**: Cannot execute quality checks until ALL required rules confirmed active
17
+
18
+ ## Plan Injection Requirement [MANDATORY]
19
+
20
+ **Upon reading this file, IMMEDIATELY inject to work plan:**
21
+ 1. All BLOCKING READs identified in Loading Protocol above:
22
+ - `.agents/rules/language/rules.md` (if not active)
23
+ - `.agents/rules/language/testing.md` (if not active)
24
+ 2. Mark each with "[From quality-assurance.md]" source tag
25
+ 3. Show evidence of injection:
26
+ ```
27
+ [PLAN INJECTION FROM quality-assurance.md]
28
+ Injected to work plan:
29
+ ✓ BLOCKING READ: language/rules.md - quality standards
30
+ ✓ BLOCKING READ: language/testing.md - testing requirements
31
+ Status: VERIFIED
32
+ ```
33
+
34
+ **ENFORCEMENT:** Cannot proceed without Plan Injection evidence
35
+
36
+ **EVIDENCE REQUIRED:**
37
+ ```
38
+ Rule Status Verification:
39
+ ✓ language/rules.md - ACTIVE (loaded/verified)
40
+ ✓ testing.md - ACTIVE (loaded/verified)
41
+ ```
42
+
43
+ ## Task Completion Gate [STRICT ENFORCEMENT - NO EXCEPTIONS]
44
+
45
+ **CANNOT mark task as complete until ALL quality checks pass:**
46
+ □ Plan Injection completed (from quality-assurance.md Plan Injection Requirement)
47
+ □ Work plan contains ALL BLOCKING READs from this file
48
+ □ Build process succeeds
49
+ □ Tests pass (or no tests if not applicable)
50
+ □ Linting: 0 errors
51
+ □ Static analysis passes (if applicable)
52
+ □ Manual testing performed (if applicable)
53
+ □ Changes committed to git (for implementation tasks)
54
+ □ Task tracking updated (work plan checkbox if using workflow)
55
+
56
+ **If any check fails:**
57
+ → Fix issues before proceeding
58
+ → Do NOT skip or mark task complete
59
+ → Do NOT commit with failing checks
60
+
61
+ ## Purpose
62
+
63
+ Ensure code quality through systematic verification and testing.
64
+
65
+ ## When to Use [MANDATORY TIMING]
66
+
67
+ - **After every implementation** (required)
68
+ - **Before marking any task done** (mandatory)
69
+ - When quality issues suspected
70
+ - During code review
71
+ - Before deployment
72
+
73
+ ## Completion Conditions
74
+
75
+ □ Build process succeeds
76
+ □ All tests pass
77
+ □ Linting reports 0 errors
78
+ □ Code formatting verified
79
+ □ Static analysis passes (if applicable)
80
+ □ Test coverage meets requirements
81
+ □ Performance acceptable
82
+ □ Security checks pass
83
+ □ Documentation updated
84
+
85
+ ## Execution Guidelines
86
+
87
+ ### 1. Build Verification
88
+
89
+ Run project build:
90
+ - Ensure compilation succeeds
91
+ - Check for warnings
92
+ - Verify output artifacts
93
+ - Confirm dependencies resolved
94
+
95
+ *Note: Build commands are language-specific. Check language/testing.md*
96
+
97
+ ### 2. Test Execution
98
+
99
+ **Test Categories**
100
+ - Unit tests: Individual functions
101
+ - Integration tests: Component interactions
102
+ - End-to-end tests: Full workflows
103
+ - Performance tests: Speed and resources
104
+ - Security tests: Vulnerability checks
105
+
106
+ **Test Coverage**
107
+ - Minimum: 80% code coverage
108
+ - Critical paths: 100% coverage
109
+ - Edge cases: Documented and tested
110
+
111
+ ### 3. Code Quality Checks
112
+
113
+ **Static Analysis**
114
+ - Linting: 0 errors required
115
+ - Code formatting: Consistent style
116
+ - Language checks: No errors (static typing, style, etc.)
117
+ - Complexity: Within limits
118
+
119
+ **Code Review Criteria**
120
+ - Readability: Self-documenting
121
+ - Maintainability: Easy to modify
122
+ - Efficiency: No obvious issues
123
+ - Security: Best practices followed
124
+
125
+ ### 4. Quality Standards
126
+
127
+ | Aspect | Standard |
128
+ |--------|----------|
129
+ | Functions | ≤ 30 lines |
130
+ | Complexity | ≤ 10 cyclomatic |
131
+ | Duplication | < 5% |
132
+ | Test time | < 30 seconds total |
133
+ | Build time | < 2 minutes |
134
+ | Comments | For non-obvious only |
135
+
136
+ ### 5. Security Validation
137
+
138
+ Check for:
139
+ - Input validation present
140
+ - SQL injection prevention
141
+ - XSS protection
142
+ - Authentication properly implemented
143
+ - Authorization checks in place
144
+ - Sensitive data encrypted
145
+ - Secrets not hardcoded
146
+
147
+ ### 6. Performance Validation
148
+
149
+ Verify:
150
+ - Response times acceptable
151
+ - Memory usage reasonable
152
+ - Database queries optimized
153
+ - Caching implemented where needed
154
+ - No unnecessary loops
155
+ - Async operations proper
156
+
157
+ ### 7. Documentation Check
158
+
159
+ Ensure:
160
+ - README updated if needed
161
+ - API documentation current
162
+ - Complex logic explained
163
+ - Configuration documented
164
+ - Setup instructions clear
165
+ - Breaking changes noted
166
+
167
+ ## Quality Process
168
+
169
+ ```
170
+ 1. Run build → Must succeed
171
+ 2. Run tests → All must pass
172
+ 3. Check coverage → Meet minimums
173
+ 4. Run linter → 0 errors
174
+ 5. Check formatting → Consistent
175
+ 6. Review security → No issues
176
+ 7. Test performance → Acceptable
177
+ 8. Update docs → Current
178
+ ```
179
+
180
+ ## Common Issues and Fixes
181
+
182
+ | Issue | Likely Cause | Fix |
183
+ |-------|-------------|-----|
184
+ | Build fails | Missing dependency | Install dependencies |
185
+ | Tests fail | Logic error | Debug and fix |
186
+ | Lint errors | Style violations | Apply formatting |
187
+ | Static analysis errors | Language violations | Fix definitions/signatures |
188
+ | Slow tests | No mocking | Add test doubles |
189
+ | Security warning | Old dependency | Update packages |
190
+
191
+ ## Tools by Language
192
+
193
+ Reference `.agents/rules/language/testing.md` for:
194
+ - Language-specific test commands
195
+ - Coverage tools
196
+ - Linting configuration
197
+ - Build processes
198
+ - Security scanners
199
+
200
+ ## Pre-Deployment Checklist
201
+
202
+ □ All automated tests pass
203
+ □ Manual testing complete
204
+ □ Code reviewed
205
+ □ Documentation updated
206
+ □ Performance verified
207
+ □ Security validated
208
+ □ Rollback plan exists
209
+ □ Monitoring configured
210
+
211
+ ## Anti-Patterns
212
+
213
+ Avoid:
214
+ - Skipping tests to save time
215
+ - Ignoring warnings
216
+ - Accepting "good enough" quality
217
+ - Testing only happy path
218
+ - Ignoring performance
219
+ - Assuming security is fine
@@ -0,0 +1,263 @@
1
+ # Task Analysis
2
+
3
+ ## Required Rules [MANDATORY - MUST BE ACTIVE]
4
+
5
+ **RULE AVAILABILITY VERIFICATION:**
6
+ 1. [VERIFY ACTIVE] `.agents/rules/core/metacognition.md` (loaded at session start)
7
+ 2. [LOAD IF NOT ACTIVE] `.agents/context-maps/task-rule-matrix.yaml`
8
+
9
+ **LOADING PROTOCOL:**
10
+ - STEP 1: VERIFY metacognition.md is active from initial session setup
11
+ - STEP 2: CHECK if task-rule-matrix.yaml is active in working memory
12
+ - STEP 3: If task-rule-matrix.yaml NOT active → Execute BLOCKING READ
13
+ - STEP 4: CONFIRM all rules active before proceeding with task analysis
14
+
15
+ **EVIDENCE REQUIRED:**
16
+ ```
17
+ Rule Status Verification:
18
+ ✓ metacognition.md - ACTIVE (from session setup)
19
+ ✓ task-rule-matrix.yaml - ACTIVE (loaded/verified)
20
+ ```
21
+
22
+ ## Purpose
23
+
24
+ Determine task type, scale, and required resources.
25
+
26
+ ## When to Use
27
+
28
+ - At the start of any user request
29
+ - When task scope is unclear
30
+ - When switching to a different type of work
31
+
32
+ ## Completion Conditions
33
+
34
+ □ Task type identified (implementation/research/design/documentation/debugging/review/other)
35
+ □ Task scale determined:
36
+ - Small: 1-2 files affected
37
+ - Medium: 3-5 files affected
38
+ - Large: 6+ files affected
39
+ □ Required resources identified:
40
+ - Rules needed
41
+ - External dependencies
42
+ - Existing code to reference
43
+ □ Success criteria defined (measurable)
44
+ □ Constraints and assumptions documented
45
+
46
+ ## Mandatory Execution Order [STRICT COMPLIANCE REQUIRED]
47
+
48
+ ### Step 0: Initial Setup [BLOCKING - CANNOT SKIP]
49
+ If SESSION_BASELINE_DATE not established:
50
+ 1. [IMMEDIATE] Execute `date` command
51
+ 2. [STORE] Result as SESSION_BASELINE_DATE for ENTIRE session
52
+ 3. [ENFORCE] ALL "current/latest/recent" references MUST use SESSION_BASELINE_DATE year
53
+
54
+ VIOLATION EXAMPLE: Using "2024" in web research when SESSION_BASELINE_DATE shows "2025" = CRITICAL ERROR
55
+
56
+ ### Step 1: Understand Request Essence
57
+
58
+ - What is the user trying to achieve?
59
+ - Is this a symptom or the actual goal?
60
+ - What similar tasks have been done before?
61
+
62
+ ### Step 2: Classify Task Type [REQUIRED]
63
+
64
+ **Implementation**: Creating or modifying code
65
+ - New features
66
+ - Bug fixes
67
+ - Refactoring
68
+ - Performance optimization
69
+
70
+ **Research**: Information gathering
71
+ - Code exploration
72
+ - Architecture analysis
73
+ - Feasibility studies
74
+
75
+ **Design**: Planning and documentation
76
+ - Technical specifications
77
+ - Architecture decisions
78
+ - API design
79
+
80
+ **Documentation**: Writing docs
81
+ - README updates
82
+ - API documentation
83
+ - User guides
84
+
85
+ **Debugging**: Problem solving
86
+ - Error investigation
87
+ - Performance analysis
88
+ - Behavior diagnosis
89
+
90
+ **Review**: Evaluation and verification
91
+ - Technical document review (design docs, ADRs)
92
+ - Code review
93
+ - Test review (integration/E2E tests)
94
+
95
+ ### Step 3: Estimate Scale [REQUIRED]
96
+
97
+ Count affected components:
98
+ - Number of files to create/modify
99
+ - Number of systems/modules involved
100
+ - Integration complexity
101
+ - Testing requirements
102
+
103
+ ### Step 4: Execute Rule Selection [BLOCKING CHECKPOINT]
104
+
105
+ **EXECUTION GATES - System HALTS if any step skipped:**
106
+ 1. [BLOCKING READ] `task-rule-matrix.yaml` from `.agents/context-maps/`
107
+ 2. [MANDATORY MATCHING] Task type + scale against matrix
108
+ 3. [CLASSIFICATION OUTPUT]:
109
+ - Required rules: IMMEDIATE BLOCKING READ
110
+ - Recommended rules: EVALUATE context, then BLOCKING READ if applicable
111
+ - Conditional rules: CHECK conditions, then BLOCKING READ if met
112
+ 4. [VERIFICATION GATE] CANNOT PROCEED until ALL required rules loaded
113
+ 5. [PROOF OF COMPLIANCE] Output must list:
114
+ ```
115
+ Rules Successfully Loaded:
116
+ ✓ [filepath] - [reason for loading]
117
+ ✓ [filepath] - [applied to which aspect]
118
+ ```
119
+ 6. [PLAN INJECTION] IMMEDIATELY inject all identified BLOCKING READs to work plan:
120
+ ```
121
+ [PLAN INJECTION FROM task-analysis - Rule Selection]
122
+ Injected BLOCKING READs from rule selection:
123
+ ✓ [filepath] - required rule
124
+ ✓ [filepath] - conditional rule (condition met)
125
+ ```
126
+
127
+ ### Step 5: Identify Additional Resources
128
+
129
+ Determine what's needed:
130
+ - Which rule files apply
131
+ - External libraries/tools
132
+ - Reference implementations
133
+ - Documentation sources
134
+
135
+ ### Step 6: Define Success Criteria
136
+
137
+ - Specific functionality works
138
+ - Tests pass
139
+ - Performance metrics met
140
+ - Documentation complete
141
+
142
+ ### Step 7: Workflow Recommendation
143
+
144
+ Based on scale and complexity:
145
+ - **Small Scale (1-2 files)**: Direct task execution, no workflow needed
146
+ - **Medium/Large Scale (3+ files)**: RECOMMEND agentic-coding.md workflow
147
+ - Ask: "This task would benefit from a structured workflow with design document and work plan. Proceed? [Y/n]"
148
+ - If YES: Load and follow agentic-coding.md
149
+ - If NO: Execute individual task definitions directly
150
+
151
+ ### Step 8: Mandatory Plan Injection [BLOCKING - AUTOMATIC EXECUTION]
152
+
153
+ **FOR ALL TASKS WITH BLOCKING READ REQUIREMENTS:**
154
+
155
+ 1. **[SCAN FOR BLOCKING READS]** Identify ALL files requiring BLOCKING READ:
156
+ - From selected workflow (if Medium/Large scale)
157
+ - From task definitions to be executed
158
+ - From rules that will be loaded
159
+
160
+ 2. **[AUTOMATIC INJECTION]** Add ALL identified BLOCKING READs to work plan:
161
+ ```
162
+ Plan Injection Required:
163
+ □ BLOCKING READ: [file path] - [reason/phase]
164
+ □ BLOCKING READ: [file path] - [reason/phase]
165
+ □ Rule Status Verification after each BLOCKING READ
166
+ ```
167
+
168
+ 3. **[EVIDENCE REQUIRED]** Show plan injection confirmation:
169
+ ```
170
+ [PLAN INJECTION COMPLETED]
171
+ Identified BLOCKING READs from:
172
+ ✓ Workflow phases: [list files]
173
+ ✓ Task definitions: [list files]
174
+ ✓ Required rules: [list files]
175
+
176
+ Injected to plan:
177
+ ✓ Total BLOCKING READs: [count]
178
+ ✓ Verification gates: [count]
179
+ ```
180
+
181
+ 4. **[ENFORCEMENT]** CANNOT proceed without:
182
+ - ALL BLOCKING READs identified and injected
183
+ - Plan injection evidence shown above
184
+ - Each BLOCKING READ as explicit task in work plan
185
+
186
+ **VIOLATION HANDLING:**
187
+ - Missing any BLOCKING READ from plan = IMMEDIATE HALT
188
+ - Skipping any BLOCKING READ during execution = CRITICAL ERROR
189
+ - Proceeding without verification = RETURN TO TASK ANALYSIS
190
+
191
+ ## Deliverables
192
+
193
+ - Task classification output
194
+ - Path recommendation
195
+
196
+ ## Common Patterns
197
+
198
+ ### Feature Request
199
+ 1. Identify core functionality
200
+ 2. Estimate component changes
201
+ 3. Consider edge cases
202
+ 4. Plan testing approach
203
+
204
+ ### Bug Fix
205
+ 1. Understand expected vs actual behavior
206
+ 2. Identify affected components
207
+ 3. Determine root cause approach
208
+ 4. Plan verification method
209
+
210
+ ### Refactoring
211
+ 1. Identify improvement goals
212
+ 2. Assess current structure
213
+ 3. Estimate change scope
214
+ 4. Plan incremental approach
215
+
216
+ ### Review
217
+ 1. Identify review target (document/code/tests)
218
+ 2. Load appropriate review task definition
219
+ 3. Apply review criteria from task definition
220
+ 4. Document findings and recommendations
221
+
222
+ ## Decision Tree
223
+
224
+ **Code-related?**
225
+ - YES → Creating new code?
226
+ - YES: Implementation task
227
+ - NO → Fixing issues?
228
+ - YES: Debugging task
229
+ - NO: Refactoring task
230
+ - NO → Evaluating existing work?
231
+ - YES: Review task → Determine target:
232
+ - Document (design/ADR) → technical-document-review
233
+ - Code → code-review
234
+ - Tests → integration-test-review
235
+ - NO → Information gathering?
236
+ - YES: Research task
237
+ - NO → Planning?
238
+ - YES: Design task
239
+ - NO: Documentation task
240
+
241
+ ## Rule Selection Output Format [SYSTEM VERIFICATION REQUIRED]
242
+
243
+ ### BLOCKING OUTPUT - Cannot proceed without this exact format:
244
+ ```
245
+ [RULE SELECTION CHECKPOINT]
246
+ Task Type: [type]
247
+ Task Scale: [scale]
248
+ SESSION_BASELINE_DATE: [stored date from initial setup]
249
+
250
+ Path Recommendation:
251
+ - [Direct execution of task definitions] OR
252
+ - [Workflow recommended: agentic-coding.md]
253
+
254
+ Required Rules [BLOCKING READS - MUST BE LOADED]:
255
+ ✓ [path/to/rule1.md] - LOADED - [applying to: specific aspect]
256
+ ✓ [path/to/rule2.md] - LOADED - [applying to: specific aspect]
257
+
258
+ Conditional Rules [LOAD IF CONDITION MET]:
259
+ ✓ [path/to/rule3.md] - LOADED - [trigger: "test" keyword found in task]
260
+ ✗ [path/to/rule4.md] - NOT LOADED - [trigger not met: no performance requirements]
261
+
262
+ VERIFICATION: All required rules active in working memory
263
+ ```