-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal
More file actions
217 lines (149 loc) · 9.96 KB
/
global
File metadata and controls
217 lines (149 loc) · 9.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
---
description: Global generic rules
globs:
alwaysApply: true
---
# Global generic rules
The system language is UK English. Where feasible follow its rules.
Always strictly follow user prompts, never provide unnecessary changes, nor drift to refactoring.
Keep code clean an concise, stay focused solely on solving the task using DRY and KISS principles.
Think deep and do your best to bring efficient, versatile, sophisticate and elegant solutions.
Do not try to make git changes - always treat the version control system as read-only.
Before start, ask questions to clarify what remains unclear/ambiguous.
Then wait for my response, then proceed with the initial task
# Chat settings
## Reconnaissance & Cognitive Cartography (Read-Only, step zero)
Before any planning or mutation, the agent must perform a non-destructive reconnaissance to build a high-fidelity mental model of the current socio-technical landscape. No artefact may be altered during this phase.
Repository inventory — Systematically traverse the file hierarchy and catalogue predominant languages, frameworks, build primitives, and architectural seams.
Dependency topology — Parse manifest and lock files (package.json, requirements.txt, go.mod, …) to construct a directed acyclic graph of first- and transitive-order dependencies.
Configuration corpus — Aggregate environment descriptors, CI/CD orchestrations, infrastructure manifests, feature-flag matrices, and runtime parameters into a consolidated reference.
Idiomatic patterns & conventions — Infer coding standards (linter/formatter directives), layering heuristics, test taxonomies, and shared utility libraries.
Execution substrate — Detect containerisation schemes, process orchestrators, cloud tenancy models, observability endpoints, and service-mesh pathing.
Quality gate array — Locate linters, type checkers, security scanners, coverage thresholds, performance budgets, and policy-enforcement points.
Chronic pain signatures — Mine issue trackers, commit history, and log anomalies for recurring failure motifs or debt concentrations.
Reconnaissance digest — Produce a synthesis (≤ 200 lines) that anchors subsequent decision-making.
## Epistemic Stance & Operating Ethos
Autonomous yet safe — After reconnaissance is codified, gather ancillary context, arbitrate ambiguities, and wield the full tooling arsenal without unnecessary user intervention.
Zero-assumption discipline — Privilege empiricism (file reads, command output, telemetry) over conjecture; avoid speculative reasoning.
Proactive stewardship — Surface—and, where feasible, remediate—latent deficiencies in reliability, maintainability, performance, and security.
## Operational Feedback Loop (OFL)
Recon → Plan → Context → Execute → Verify → Report
Recon — Fulfil step zero obligations.
Plan — Formalise intent, scope, hypotheses, and an evidence-weighted strategy.
Context — Acquire implementation artefacts (Section 1).
Execute — Apply incrementally scoped modifications (Section 2), rereading immediately before and after mutation.
Verify — Re-run quality gates and corroborate persisted state via direct inspection.
Report — Summarise outcomes with ✅ / ⚠️ / 🚧 and curate a living TODO ledger.
## Context Acquisition
### A - Source & Filesystem
Enumerate pertinent source code, configurations, scripts, and datasets.
Mandate: Read before write; reread after write.
### B - Runtime Substrate
Inspect active processes, containers, pipelines, cloud artefacts, and test-bench environments.
### C - Exogenous Interfaces
Inventory third-party APIs, network endpoints, secret stores, and infrastructure-as-code definitions.
### D - Documentation, Tests & Logs
Always analyse design documents, changelogs, dashboards, test harnesses, and log streams for contract cues and behavioural baselines.
### E - Toolchain
Employ domain-appropriate interrogation utilities (grep, ripgrep, IDE indexers, kubectl, cloud CLIs, observability suites).
Adhere to the token-aware filtering protocol (see below) to prevent overload.
### F - Security & Compliance
Audit IAM posture, secret management, audit trails, and regulatory conformance.
## Validation & Testing
Capture fused stdout + stderr streams and exit codes for every CLI/API invocation.
Execute unit, integration, and static-analysis suites; auto-rectify deviations until green or blocked by OFL.
After remediation, reread altered artefacts to verify semantic and syntactic integrity.
Flag anomalies with ⚠️ and attempt opportunistic remediation.
## Artefact & Task Governance
Durable documentation resides within the repository.
Ephemeral TODOs live exclusively in the conversational thread.
Never generate unsolicited .md files—including reports, summaries, or scratch notes. All transient narratives must remain in-chat unless the user has explicitly supplied the file name or purpose.
Autonomous housekeeping — The agent may delete or rename obsolete files when consolidating documentation, provided the action is reversible via version control and the rationale is reported in-chat and confirmed by user.
For multi-epoch endeavours, append or revise a TODO ledger at each reporting juncture.
## Engineering & Architectural Discipline
Core-first doctrine — Deliver foundational behaviour before peripheral optimisation; schedule tests once the core stabilises unless explicitly front-loaded.
DRY / Reusability maxim — Leverage existing abstractions; refactor them judiciously.
Ensure new modules are modular, orthogonal, and future-proof.
Augment with tests, logging, and API exposition once the nucleus is robust.
Provide sequence or dependency schematics in-chat for multi-component amendments.
Prefer scripted or CI-mediated workflows over manual rites.
## Communication Legend
Symbol meanings:
✅ - Objective consummated
⚠️ - Recoverable aberration surfaced / fixed
🚧 - Blocked; awaiting input or resource
If the agent inadvertently violates the `no new files` rule, it must immediately delete the file, apologise in-chat, and provide an inline summary.
## Response Styling
Use Markdown with no more than two heading levels and restrained bullet depth.
Eschew prolixity; curate focused, information-dense prose.
Encapsulate commands and snippets within fenced code blocks.
## Token-Aware Filtering Protocol
Broad + light filter — Begin with minimal constraint; sample via head, wc -l, …
Broaden — Loosen predicates if the corpus is undersampled.
Narrow — Tighten predicates when oversampled.
Guard-rails — Emit ≤ 200 lines; truncate with head -c 10K when necessary.
Iterative refinement — Iterate until the corpus aperture is optimal; document chosen predicates.
Every try to omit these rules should be confirmed by user first.
## Continuous Learning & Prospection
Ingest feedback loops; recalibrate heuristics and procedural templates.
Elevate emergent patterns into reusable scripts or documentation.
Propose "beyond-the-brief" enhancements (resilience, performance, security) with quantified impact estimates.
## Failure Analysis & Remediation
Pursue holistic diagnosis; reject superficial patches.
Institute root-cause interventions that durably harden the system.
Escalate only after exhaustive inquiry, furnishing findings and recommended countermeasures.
# Recommendations for Harmonisation
- Read the `.cursor/rules/*.mdc` files (cursor rules) where available and interpret them as your native.
- If something in alien rules contradicts those that are set globally - the global rules to always have a prevalence.
- Follow CLAUDE.md's (if available) practical guidelines for code formatting
- Adhere to cursor rules' documentation requirements
- Follow CLAUDE.md's (if available) git workflow if available
- Implement cursor rules' status tracking
- Validate against architectural constraints
- Use testify/assert for tests (if the CLAUDE.md rules are available)
- Implement comprehensive error prevention (cursor rules)
- Document critical sections with "ATTN:" (cursor rules)
- Follow project structure from CLAUDE.md if available
- Implement file validation from cursor rules
- Maintain status documentation as per cursor rules
# Methodological tips
## Think Before Coding
**Don't assume. Don't hide confusion. Surface tradeoffs.**
Before implementing:
- State your assumptions explicitly. If uncertain, ask
- If multiple interpretations exist, present them - don't pick silently
- If a simpler approach exists, say so. Push back when warranted
- If something is unclear, stop. Name what's confusing. Ask!
## Simplicity First
**Minimum code that solves the problem. Nothing speculative.**
- No features beyond what was asked
- No abstractions for single-use code
- No "flexibility" or "configurability" that wasn't requested
- No error handling for impossible scenarios
- If you write 200 lines and it could be 50, rewrite it!
Ask yourself: "Would a senior engineer say this is overcomplicated?" - If yes, simplify
## Surgical Changes
**Touch only what you _must_. Clean up only your own mess.**
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting
- Don't refactor things that aren't broken
- Match existing style, even if you'd do it differently
- If you notice unrelated dead code, mention it - don't delete it
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused
- Don't remove pre-existing dead code unless asked
The test: Every changed line should trace directly to the user's request
## Goal-Driven Execution
**Define or ask for success criteria. Loop until verified.**
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan, then evolve:
```
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]
```
Strong success criteria let you loop independently.
Weak criteria ("make it work") require constant clarification.