contextos-agents 2.3.1 → 2.3.2
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/.agents/adapters/cursor/export.js +3 -27
- package/.agents/adapters/gemini/export.js +5 -7
- package/.agents/adapters/shared.js +14 -1
- package/.agents/adapters/zed/export.js +4 -16
- package/.agents/compiled/registry.v2.json +33 -33
- package/.agents/compiled/registry.v2.sha256 +1 -1
- package/.agents/compiler/manifest-compiler.js +8 -5
- package/.agents/core/skills/context-manager/EXAMPLES.md +5 -17
- package/.agents/core/skills/context-manager/SKILL.md +10 -100
- package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +6 -6
- package/.agents/core/skills/context-manager/VALIDATION.json +115 -4
- package/.agents/core/skills/context-manager/references/context-rules.md +3 -57
- package/.agents/core/skills/context-manager/skill.yaml +1 -3
- package/.agents/core/skills/context-os/EXAMPLES.md +25 -15
- package/.agents/core/skills/context-os/SKILL.md +12 -135
- package/.agents/core/skills/context-os/TROUBLESHOOTING.md +11 -6
- package/.agents/core/skills/context-os/VALIDATION.json +115 -4
- package/.agents/core/skills/context-os/packs.yaml +10 -59
- package/.agents/core/skills/context-os/references/context-rules.md +27 -59
- package/.agents/core/skills/context-os/references/pipeline.md +14 -119
- package/.agents/core/skills/context-os/references/project-graph.md +11 -100
- package/.agents/core/skills/context-os/rules.yaml +8 -135
- package/.agents/core/skills/engineering-workflow/EXAMPLES.md +15 -50
- package/.agents/core/skills/engineering-workflow/SKILL.md +10 -10
- package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
- package/.agents/core/skills/engineering-workflow/VALIDATION.json +115 -4
- package/.agents/core/skills/engineering-workflow/references/workflow.md +55 -317
- package/.agents/core/skills/gemini-precision/EXAMPLES.md +33 -53
- package/.agents/core/skills/gemini-precision/SKILL.md +11 -147
- package/.agents/core/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
- package/.agents/core/skills/gemini-precision/VALIDATION.json +115 -4
- package/.agents/core/skills/gemini-precision/skill.yaml +1 -1
- package/.agents/core/skills/gstack-roles/EXAMPLES.md +5 -21
- package/.agents/core/skills/gstack-roles/SKILL.md +10 -12
- package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
- package/.agents/core/skills/gstack-roles/VALIDATION.json +115 -4
- package/.agents/core/skills/gstack-roles/references/roles.md +3 -147
- package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +12 -45
- package/.agents/core/skills/ponytail-mindset/SKILL.md +10 -13
- package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
- package/.agents/core/skills/ponytail-mindset/VALIDATION.json +115 -4
- package/.agents/core/skills/ponytail-mindset/references/minimalism.md +58 -174
- package/.agents/core/skills/security/EXAMPLES.md +19 -55
- package/.agents/core/skills/security/SKILL.md +61 -137
- package/.agents/core/skills/security/TROUBLESHOOTING.md +13 -19
- package/.agents/core/skills/security/VALIDATION.json +115 -4
- package/.agents/core/skills/security/skill.yaml +1 -1
- package/.agents/generated/claude/skills/context-manager/EXAMPLES.md +5 -17
- package/.agents/generated/claude/skills/context-manager/SKILL.md +9 -96
- package/.agents/generated/claude/skills/context-manager/TROUBLESHOOTING.md +6 -6
- package/.agents/generated/claude/skills/context-manager/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/context-manager/references/context-rules.md +3 -57
- package/.agents/generated/claude/skills/context-os/EXAMPLES.md +25 -15
- package/.agents/generated/claude/skills/context-os/SKILL.md +11 -133
- package/.agents/generated/claude/skills/context-os/TROUBLESHOOTING.md +11 -6
- package/.agents/generated/claude/skills/context-os/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/context-os/packs.yaml +10 -59
- package/.agents/generated/claude/skills/context-os/references/context-rules.md +27 -59
- package/.agents/generated/claude/skills/context-os/references/pipeline.md +14 -119
- package/.agents/generated/claude/skills/context-os/references/project-graph.md +11 -100
- package/.agents/generated/claude/skills/context-os/rules.yaml +8 -135
- package/.agents/generated/claude/skills/engineering-workflow/EXAMPLES.md +15 -50
- package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +9 -9
- package/.agents/generated/claude/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
- package/.agents/generated/claude/skills/engineering-workflow/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/engineering-workflow/references/workflow.md +55 -317
- package/.agents/generated/claude/skills/gemini-precision/EXAMPLES.md +33 -53
- package/.agents/generated/claude/skills/gemini-precision/SKILL.md +10 -143
- package/.agents/generated/claude/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
- package/.agents/generated/claude/skills/gemini-precision/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/gstack-roles/EXAMPLES.md +5 -21
- package/.agents/generated/claude/skills/gstack-roles/SKILL.md +9 -11
- package/.agents/generated/claude/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
- package/.agents/generated/claude/skills/gstack-roles/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/gstack-roles/references/roles.md +3 -147
- package/.agents/generated/claude/skills/ponytail-mindset/EXAMPLES.md +12 -45
- package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +9 -12
- package/.agents/generated/claude/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
- package/.agents/generated/claude/skills/ponytail-mindset/VALIDATION.json +115 -4
- package/.agents/generated/claude/skills/ponytail-mindset/references/minimalism.md +58 -174
- package/.agents/generated/claude/skills/security/EXAMPLES.md +19 -55
- package/.agents/generated/claude/skills/security/SKILL.md +60 -134
- package/.agents/generated/claude/skills/security/TROUBLESHOOTING.md +13 -19
- package/.agents/generated/claude/skills/security/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/context-manager/EXAMPLES.md +5 -17
- package/.agents/generated/gemini/skills/context-manager/SKILL.md +10 -99
- package/.agents/generated/gemini/skills/context-manager/TROUBLESHOOTING.md +6 -6
- package/.agents/generated/gemini/skills/context-manager/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/context-manager/references/context-rules.md +3 -57
- package/.agents/generated/gemini/skills/context-os/EXAMPLES.md +25 -15
- package/.agents/generated/gemini/skills/context-os/SKILL.md +12 -135
- package/.agents/generated/gemini/skills/context-os/TROUBLESHOOTING.md +11 -6
- package/.agents/generated/gemini/skills/context-os/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/context-os/packs.yaml +10 -59
- package/.agents/generated/gemini/skills/context-os/references/context-rules.md +27 -59
- package/.agents/generated/gemini/skills/context-os/references/pipeline.md +14 -119
- package/.agents/generated/gemini/skills/context-os/references/project-graph.md +11 -100
- package/.agents/generated/gemini/skills/context-os/rules.yaml +8 -135
- package/.agents/generated/gemini/skills/engineering-workflow/EXAMPLES.md +15 -50
- package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +10 -11
- package/.agents/generated/gemini/skills/engineering-workflow/TROUBLESHOOTING.md +11 -19
- package/.agents/generated/gemini/skills/engineering-workflow/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/engineering-workflow/references/workflow.md +55 -317
- package/.agents/generated/gemini/skills/gemini-precision/EXAMPLES.md +33 -53
- package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +11 -145
- package/.agents/generated/gemini/skills/gemini-precision/TROUBLESHOOTING.md +12 -25
- package/.agents/generated/gemini/skills/gemini-precision/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/gstack-roles/EXAMPLES.md +5 -21
- package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +10 -13
- package/.agents/generated/gemini/skills/gstack-roles/TROUBLESHOOTING.md +6 -12
- package/.agents/generated/gemini/skills/gstack-roles/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/gstack-roles/references/roles.md +3 -147
- package/.agents/generated/gemini/skills/ponytail-mindset/EXAMPLES.md +12 -45
- package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +10 -14
- package/.agents/generated/gemini/skills/ponytail-mindset/TROUBLESHOOTING.md +10 -19
- package/.agents/generated/gemini/skills/ponytail-mindset/VALIDATION.json +115 -4
- package/.agents/generated/gemini/skills/ponytail-mindset/references/minimalism.md +58 -174
- package/.agents/generated/gemini/skills/security/EXAMPLES.md +19 -55
- package/.agents/generated/gemini/skills/security/SKILL.md +61 -136
- package/.agents/generated/gemini/skills/security/TROUBLESHOOTING.md +13 -19
- package/.agents/generated/gemini/skills/security/VALIDATION.json +115 -4
- package/.agents/resolver/canonical-resolver.js +34 -21
- package/.agents/rules/rule-catalog.js +5 -5
- package/.agents/validate.js +9 -2
- package/.agents/validation-evidence.js +89 -0
- package/README.md +132 -207
- package/catalog/skills/typescript/SKILL.md +16 -2
- package/package.json +3 -2
|
@@ -2,117 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Deprecated compatibility identifier. Use [context-os](../context-os/SKILL.md) for the canonical instructions.
|
|
6
6
|
|
|
7
7
|
## When to Use
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
An existing configuration or user explicitly names context-manager.
|
|
10
10
|
|
|
11
11
|
## Rules & Patterns
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## How It Works
|
|
16
|
-
|
|
17
|
-
When given a task:
|
|
18
|
-
|
|
19
|
-
### Step 1: Classify the task
|
|
20
|
-
|
|
21
|
-
```yaml
|
|
22
|
-
task:
|
|
23
|
-
type: [frontend | backend | fullstack | architecture | bugfix | refactor | deploy | review]
|
|
24
|
-
scope: [module | feature | file | project-wide]
|
|
25
|
-
module: {{module_name from Project Graph}}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Step 2: Consult the Project Graph
|
|
29
|
-
|
|
30
|
-
If `docs/PROJECT_GRAPH.md` or `.graphify/graph.json` exists (or activate `graphify` skill to extract AST dependencies):
|
|
31
|
-
|
|
32
|
-
1. Find the module this task belongs to
|
|
33
|
-
2. Get the module's dependencies
|
|
34
|
-
3. Get the module's required skills
|
|
35
|
-
4. Get the files this task will likely touch
|
|
36
|
-
|
|
37
|
-
### Step 3: Apply Context Rules
|
|
38
|
-
|
|
39
|
-
Load `references/context-rules.md` and apply the task type → document mapping.
|
|
40
|
-
|
|
41
|
-
### Step 4: Return Context Package
|
|
42
|
-
|
|
43
|
-
Output a context package:
|
|
44
|
-
|
|
45
|
-
```yaml
|
|
46
|
-
context:
|
|
47
|
-
documents:
|
|
48
|
-
required:
|
|
49
|
-
- docs/API.md # sections: [appointments]
|
|
50
|
-
- docs/ARCHITECTURE.md # sections: [backend, api-layer]
|
|
51
|
-
optional:
|
|
52
|
-
- docs/decisions/0003-postgres.md
|
|
53
|
-
skipped:
|
|
54
|
-
- docs/UI.md # reason: backend task
|
|
55
|
-
- docs/DATABASE.md # reason: no schema change
|
|
56
|
-
|
|
57
|
-
skills:
|
|
58
|
-
loaded: [typescript, node, postgres, testing]
|
|
59
|
-
skipped: [react, tailwind] # reason: backend task
|
|
60
|
-
|
|
61
|
-
project_graph:
|
|
62
|
-
module: appointments
|
|
63
|
-
dependencies: [auth, patients]
|
|
64
|
-
affected_files:
|
|
65
|
-
- src/modules/appointments/api/**
|
|
66
|
-
- src/modules/appointments/services/**
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Step 5: Validate Budget
|
|
70
|
-
|
|
71
|
-
Check total token count. If over budget (see context-rules.md):
|
|
72
|
-
|
|
73
|
-
1. Trim Level 1 docs to summaries
|
|
74
|
-
2. Load only affected sections of Level 2 docs
|
|
75
|
-
3. Keep Level 3 (skills) at full detail
|
|
76
|
-
|
|
77
|
-
## Context Caching
|
|
78
|
-
|
|
79
|
-
After first compilation for a module, cache the result:
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
.cache/
|
|
83
|
-
frontend.context.yaml
|
|
84
|
-
backend.context.yaml
|
|
85
|
-
appointments.context.yaml
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Invalidate cache when:
|
|
89
|
-
|
|
90
|
-
- A document is updated
|
|
91
|
-
- A skill is added/removed
|
|
92
|
-
- The Project Graph changes
|
|
93
|
-
- A Decision Record is added
|
|
94
|
-
|
|
95
|
-
## Questions the Context Manager Can Answer
|
|
96
|
-
|
|
97
|
-
- "What documents do I need for this task?"
|
|
98
|
-
- "Which skills should be loaded?"
|
|
99
|
-
- "What modules are affected by this change?"
|
|
100
|
-
- "Is this context package within budget?"
|
|
101
|
-
- "Why was this document skipped?"
|
|
102
|
-
|
|
13
|
+
Apply the canonical skill without loading a duplicate process. Existing authorization, proportional verification, and optional role declarations carry forward. The resolver redirects this identifier and reports an alias warning.
|
|
103
14
|
|
|
104
15
|
## Code Examples
|
|
105
16
|
|
|
106
|
-
|
|
17
|
+
Explicit context-manager selection resolves to context-os; inspect the resolver result rather than assuming both bodies were loaded.
|
|
107
18
|
|
|
108
19
|
## Validation Checklist
|
|
109
20
|
|
|
110
|
-
|
|
21
|
+
- [ ] Canonical guidance is used.
|
|
22
|
+
- [ ] Alias resolution adds no duplicate body.
|
|
23
|
+
- [ ] Evidence scope and limitations are stated.
|
|
111
24
|
|
|
112
25
|
## Common Mistakes
|
|
113
26
|
|
|
114
|
-
|
|
27
|
+
Treating this compatibility name as an independent engine or a mandatory ceremony.
|
|
115
28
|
|
|
116
29
|
## Integration Notes
|
|
117
30
|
|
|
118
|
-
|
|
31
|
+
Keep legacy links available. Read [references/context-rules.md](references/context-rules.md) only for compatibility details.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# context-manager
|
|
1
|
+
# context-manager compatibility troubleshooting
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
3
|
+
- Duplicate process: load the canonical context-os instructions once.
|
|
4
|
+
- Repeated approval or banners: preserve existing authorization and optional roles.
|
|
5
|
+
- Conflicting legacy guidance: use the canonical skill and update the stale link.
|
|
6
|
+
- Claimed automation: inspect actual CLI results and distinguish instructions
|
|
7
|
+
from runtime enforcement.
|
|
@@ -1,12 +1,123 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"x-contextos-evidence-contract": 1,
|
|
4
|
+
"title": "Scoped verification evidence",
|
|
5
|
+
"description": "Report shape and outcome consistency only; command execution and agent behavior require separate evidence.",
|
|
3
6
|
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"status",
|
|
10
|
+
"checks",
|
|
11
|
+
"limitations"
|
|
12
|
+
],
|
|
4
13
|
"properties": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
14
|
+
"status": {
|
|
15
|
+
"enum": [
|
|
16
|
+
"verified",
|
|
17
|
+
"partial",
|
|
18
|
+
"not_run"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"checks": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": [
|
|
27
|
+
"command",
|
|
28
|
+
"exitCode",
|
|
29
|
+
"scope"
|
|
30
|
+
],
|
|
31
|
+
"properties": {
|
|
32
|
+
"command": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
},
|
|
36
|
+
"exitCode": {
|
|
37
|
+
"type": [
|
|
38
|
+
"integer",
|
|
39
|
+
"null"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"scope": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"minLength": 1
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"limitations": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"minLength": 1
|
|
54
|
+
}
|
|
7
55
|
}
|
|
8
56
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
57
|
+
"allOf": [
|
|
58
|
+
{
|
|
59
|
+
"if": {
|
|
60
|
+
"properties": {
|
|
61
|
+
"status": {
|
|
62
|
+
"const": "verified"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"then": {
|
|
67
|
+
"properties": {
|
|
68
|
+
"checks": {
|
|
69
|
+
"minItems": 1,
|
|
70
|
+
"items": {
|
|
71
|
+
"properties": {
|
|
72
|
+
"exitCode": {
|
|
73
|
+
"const": 0
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"if": {
|
|
83
|
+
"properties": {
|
|
84
|
+
"status": {
|
|
85
|
+
"enum": [
|
|
86
|
+
"partial",
|
|
87
|
+
"not_run"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"then": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"limitations": {
|
|
95
|
+
"minItems": 1
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"if": {
|
|
102
|
+
"properties": {
|
|
103
|
+
"status": {
|
|
104
|
+
"const": "not_run"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"then": {
|
|
109
|
+
"properties": {
|
|
110
|
+
"checks": {
|
|
111
|
+
"items": {
|
|
112
|
+
"properties": {
|
|
113
|
+
"exitCode": {
|
|
114
|
+
"type": "null"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
11
122
|
]
|
|
12
123
|
}
|
|
@@ -1,59 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# context-manager compatibility reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Canonical guidance: [context-os](../../context-os/SKILL.md).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
| Task Type | Level 1 (Always) | Level 2 (If exists) | Level 3 (Per task) |
|
|
8
|
-
| --- | --- | --- | --- |
|
|
9
|
-
| **New project** | PRD, ROADMAP | ARCHITECTURE, DATABASE, API | UI, TASKS, all relevant skills |
|
|
10
|
-
| **New feature** | PRD | ARCHITECTURE, API | PROJECT_GRAPH, relevant skills |
|
|
11
|
-
| **Frontend** | — | ARCHITECTURE, API | UI, frontend skills |
|
|
12
|
-
| **Backend** | — | ARCHITECTURE, DATABASE, API | backend skills |
|
|
13
|
-
| **Database** | — | ARCHITECTURE, DATABASE | — |
|
|
14
|
-
| **Bugfix** | — | — | PROJECT_GRAPH (affected module only) |
|
|
15
|
-
| **Refactor** | — | ARCHITECTURE | PROJECT_GRAPH, affected skills |
|
|
16
|
-
| **Review** | PRD | ARCHITECTURE | TASKS, all loaded skills |
|
|
17
|
-
| **Deploy** | — | ARCHITECTURE | DEPLOYMENT, infrastructure skills |
|
|
18
|
-
|
|
19
|
-
## Skill Category to Document Mapping
|
|
20
|
-
|
|
21
|
-
| Skill Category | Required Documents | Optional Documents |
|
|
22
|
-
| --- | --- | --- |
|
|
23
|
-
| `frontend` | UI.md, API.md | ARCHITECTURE.md |
|
|
24
|
-
| `backend` | API.md, DATABASE.md | ARCHITECTURE.md |
|
|
25
|
-
| `design` | UI.md | PRD.md |
|
|
26
|
-
| `architecture` | ARCHITECTURE.md, DATABASE.md | PRD.md, API.md |
|
|
27
|
-
| `infrastructure` | ARCHITECTURE.md | — |
|
|
28
|
-
| `security` | ARCHITECTURE.md, API.md | DATABASE.md |
|
|
29
|
-
| `testing` | API.md | ARCHITECTURE.md |
|
|
30
|
-
|
|
31
|
-
## Context Budgeting
|
|
32
|
-
|
|
33
|
-
To prevent context window saturation and retain maximum LLM reasoning capacity, adhere strictly to the following 4-tier token budget:
|
|
34
|
-
|
|
35
|
-
| Priority Level | Max Tokens | Contents |
|
|
36
|
-
| --- | --- | --- |
|
|
37
|
-
| 1 (Critical) | 2,000 | Current task description, active brief, and primary skill rules |
|
|
38
|
-
| 2 (Important) | 3,000 | System architecture and API contracts for affected modules |
|
|
39
|
-
| 3 (Context) | 2,000 | Architectural Decision Records (ADRs) and relevant graph nodes |
|
|
40
|
-
| 4 (Background) | 1,000 | PRD summary and global project conventions |
|
|
41
|
-
|
|
42
|
-
**Total target context budget: ~8,000 tokens per subtask.**
|
|
43
|
-
|
|
44
|
-
### Degradation Strategy When Over Budget
|
|
45
|
-
|
|
46
|
-
If accumulated context exceeds the 8,000 token limit:
|
|
47
|
-
|
|
48
|
-
1. **Trim Level 1 documents** to high-level executive summaries.
|
|
49
|
-
2. **Slice Level 2 documents** to extract only sections matching touched module signatures.
|
|
50
|
-
3. **Preserve Level 3 skills** at full fidelity, as they contain non-negotiable operational instructions and validation guardrails.
|
|
51
|
-
|
|
52
|
-
## Module-Based Filtering via Dependency Graph
|
|
53
|
-
|
|
54
|
-
When `PROJECT_GRAPH.md` or `.graphify/graph.json` is present, traverse dependency edges to filter candidate documents:
|
|
55
|
-
|
|
56
|
-
1. Identify the primary module for the task from the symbol/path mapping.
|
|
57
|
-
2. Resolve immediate inbound and outbound dependencies (`dependencies` and `dependents`).
|
|
58
|
-
3. Include documents solely for the identified module and its immediate dependencies.
|
|
59
|
-
4. Exclude orthogonal domain documents (for example, omit database schemas during purely presentation-layer CSS/layout tasks).
|
|
5
|
+
Use the canonical resolver budget contract and workspace evidence boundaries. Load only relevant documents and source, including callers/tests when necessary. Read lockfiles or generated outputs when dependency, installation, provenance, or build investigations require them. Do not create a separate cache or promise a fixed token saving.
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ContextOS command examples
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Source checkout
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
These commands run in the ContextOS source repository:
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
```powershell
|
|
8
|
+
node .agents/ctx.js resolve "Fix IDOR in document deletion" --files src/auth.ts --json
|
|
9
|
+
node .agents/ctx.js compile --check
|
|
10
|
+
node .agents/ctx.js validate
|
|
11
|
+
node .agents/ctx.js export all --check --json
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
After authorized edits to canonical sources, compile then export before checking
|
|
15
|
+
sync. export --check is read-only; export without --check writes managed outputs.
|
|
16
|
+
The resolver returns skills and package evidence, not an automatic code-file
|
|
17
|
+
context package.
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
## Consumer project
|
|
20
|
+
|
|
21
|
+
Use the installed local ContextOS executable, for example through npx when the
|
|
22
|
+
package is already installed. Do not assume a consumer has this repository's bin
|
|
23
|
+
or scripts directories. Inspect its installation and project-specific checks.
|
|
24
|
+
Create overrides through skill override, inspect skill diff, then compile/export.
|
|
25
|
+
Preserve unmanaged user files and existing overrides.
|
|
26
|
+
|
|
27
|
+
## Evidence interpretation
|
|
28
|
+
|
|
29
|
+
A validator pass means source/configuration checks passed. A scanner pass means
|
|
30
|
+
its specified staged checks passed. Neither result proves a live client loaded
|
|
31
|
+
instructions or a model followed them.
|
|
@@ -2,156 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Guide configuration of the ContextOS compiler, resolver, profiles, and agent exports. Executable behavior lives in the CLI and modules; this Markdown entrypoint is guidance.
|
|
6
6
|
|
|
7
7
|
## When to Use
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Skill selection, context budgets, manifests, project overrides, profiles, exports, and configuration drift.
|
|
10
10
|
|
|
11
11
|
## Rules & Patterns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Inspect the active project and installed skills. Canonical sources live in .agents/core/skills; project overrides in .agents/project/skills; plugins provide additional sources. Native .agents/skills contains generated projections. Entrypoint precedence is skill.v2.yaml, skill.yaml, then manifestless SKILL.md. Respect the declared entrypoint and resolve contained resource paths relative to its skill directory.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
When a user gives you a task, follow this pipeline:
|
|
18
|
-
|
|
19
|
-
### Stage 1: Intent Analysis
|
|
20
|
-
|
|
21
|
-
Analyze the user's prompt and determine:
|
|
22
|
-
|
|
23
|
-
```yaml
|
|
24
|
-
intent:
|
|
25
|
-
project_type: [webapp, api, mobile, cli, library, saas, crm, ecommerce]
|
|
26
|
-
industry: [healthcare, fintech, education, social, general]
|
|
27
|
-
layers:
|
|
28
|
-
frontend: true/false
|
|
29
|
-
backend: true/false
|
|
30
|
-
database: true/false
|
|
31
|
-
auth: true/false
|
|
32
|
-
ai: true/false
|
|
33
|
-
payments: true/false
|
|
34
|
-
realtime: true/false
|
|
35
|
-
scope: [new_project, feature, bugfix, refactor, architecture]
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Stage 2: Dependency Resolution
|
|
39
|
-
|
|
40
|
-
For each required layer, load the skill graph:
|
|
41
|
-
|
|
42
|
-
1. Read `skill.yaml` from each relevant skill directory
|
|
43
|
-
2. Resolve `requires` - load mandatory dependencies
|
|
44
|
-
3. Check `conflicts` - ensure no incompatible skills are loaded
|
|
45
|
-
4. Apply `optional` - suggest but don't force
|
|
46
|
-
5. Respect project profile (if set) - apply rules from `profiles/`
|
|
47
|
-
|
|
48
|
-
**Dependency resolution example:**
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
Need: nextjs
|
|
52
|
-
→ requires: react, typescript
|
|
53
|
-
→ react requires: typescript (already loaded)
|
|
54
|
-
→ optional: tailwind, prisma, next-auth
|
|
55
|
-
|
|
56
|
-
Loaded: [nextjs, react, typescript]
|
|
57
|
-
Suggested: [tailwind, prisma, next-auth]
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Stage 3: Context Compilation
|
|
61
|
-
|
|
62
|
-
Assemble context from three levels:
|
|
63
|
-
|
|
64
|
-
**Level 1 - Vision (always available):**
|
|
65
|
-
|
|
66
|
-
- `docs/PRD.md` - what are we building
|
|
67
|
-
- `docs/ROADMAP.md` - where are we going
|
|
68
|
-
- `docs/PROJECT_GRAPH.md` - project structure
|
|
69
|
-
- `docs/API.md` - API specification (optional, when backend API layer is present)
|
|
70
|
-
- `docs/UI.md` - UI/UX specification (optional, when UI layer is present)
|
|
71
|
-
|
|
72
|
-
**Level 2 - Architecture (load when needed):**
|
|
73
|
-
|
|
74
|
-
- `docs/ARCHITECTURE.md` - system design and boundaries
|
|
75
|
-
- `docs/decisions/` - architecture decision records (ADRs)
|
|
76
|
-
- `docs/PRODUCT_BOUNDARIES.md` - maturity boundaries and non-promises
|
|
77
|
-
- `references/context-rules.md` - dynamic context selection and compilation rules
|
|
78
|
-
|
|
79
|
-
**Level 3 - Task-Specific Context (load per task):**
|
|
80
|
-
|
|
81
|
-
- Relevant skill documents from `.agents/skills/`
|
|
82
|
-
- Target code and test files within planned blast radius
|
|
83
|
-
|
|
84
|
-
### Stage 4: Focused Context Selection
|
|
85
|
-
|
|
86
|
-
Before sending context to the AI coding assistant:
|
|
87
|
-
|
|
88
|
-
1. Select only skills relevant to the task domain and touched files
|
|
89
|
-
2. Prioritize: task goal > architectural constraints > project conventions
|
|
90
|
-
3. Include active Decision Records that affect the target component
|
|
91
|
-
4. Enforce quality guardrails and verification criteria
|
|
92
|
-
|
|
93
|
-
## Core CLI Commands
|
|
94
|
-
|
|
95
|
-
| Command | Action |
|
|
96
|
-
| --- | --- |
|
|
97
|
-
| `contextos init` | Initialize `.agents/` folder and bootstrap profiles |
|
|
98
|
-
| `contextos export <agent>` | Compile skills for target agent (`gemini`, `claude`, `cursor`, `copilot`, `aider`, `zed`, `all`) |
|
|
99
|
-
| `contextos resolve "<task>"` | Dynamically resolve relevant skills, rules, and risk level for task |
|
|
100
|
-
| `contextos validate` | Validate skill schemas, dependencies, and detect configuration drift |
|
|
101
|
-
| `contextos doctor` | Pre-flight diagnostics for skills, profiles, and compiler synchronization |
|
|
102
|
-
| `contextos watch` | Background file watcher for continuous auto-compilation |
|
|
103
|
-
|
|
104
|
-
## Project Initialization Flow
|
|
105
|
-
|
|
106
|
-
When user says something like "Сделай CRM для стоматологии" or "Build a Trello clone":
|
|
107
|
-
|
|
108
|
-
1. **Analyze intent** (Stage 1)
|
|
109
|
-
2. **Ask clarifying questions:**
|
|
110
|
-
- Users and roles?
|
|
111
|
-
- Tech stack preference?
|
|
112
|
-
- Mobile app needed?
|
|
113
|
-
- AI features?
|
|
114
|
-
- Authentication type?
|
|
115
|
-
- Expected load?
|
|
116
|
-
- MVP or Production?
|
|
117
|
-
3. **Select profile** (startup/enterprise/mvp/hackathon)
|
|
118
|
-
4. **Resolve skills** (Stage 2)
|
|
119
|
-
5. **Generate all documents** using `generators/` skill
|
|
120
|
-
6. **Create Project Graph** - the master map of modules -> features -> tasks -> files -> skills
|
|
121
|
-
7. **Output agent config** using `adapters/` skill
|
|
122
|
-
|
|
123
|
-
## Skill Discovery
|
|
124
|
-
|
|
125
|
-
Skills are discovered by scanning `.agents/skills/*/skill.yaml`. Each `skill.yaml` defines:
|
|
126
|
-
|
|
127
|
-
```yaml
|
|
128
|
-
id: react
|
|
129
|
-
name: React
|
|
130
|
-
category: frontend
|
|
131
|
-
tags: [frontend, spa, jsx, components]
|
|
132
|
-
requires: [typescript]
|
|
133
|
-
optional: [tailwind, next-auth, react-query]
|
|
134
|
-
conflicts: [vue, angular, svelte]
|
|
135
|
-
weight: 8
|
|
136
|
-
documents:
|
|
137
|
-
- react.md
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
The compiler builds a dependency graph from all discovered skills and resolves it for each task.
|
|
15
|
+
Use the resolver with the task and affected files; inspect reasons, risk, warnings, missing skills, and soft-budget overflow. Load references only when needed. Existing authorization and proportional engineering-workflow apply.
|
|
141
16
|
|
|
17
|
+
Read [references/context-rules.md](references/context-rules.md) for budgeting and [references/project-graph.md](references/project-graph.md) for graph limits.
|
|
142
18
|
|
|
143
19
|
## Code Examples
|
|
144
20
|
|
|
145
|
-
See
|
|
21
|
+
In this source checkout: node .agents/ctx.js resolve "Fix IDOR" --files src/auth.ts --json. See EXAMPLES.md for source and consumer command boundaries.
|
|
146
22
|
|
|
147
23
|
## Validation Checklist
|
|
148
24
|
|
|
149
|
-
|
|
25
|
+
- [ ] The requested outcome and applicable failure cases are checked.
|
|
26
|
+
- [ ] Evidence names commands, results, scope, and limitations.
|
|
27
|
+
- [ ] Unrelated changes and existing authorization are preserved.
|
|
150
28
|
|
|
151
29
|
## Common Mistakes
|
|
152
30
|
|
|
153
|
-
|
|
31
|
+
Editing generated projections; assuming catalog skills are installed; treating an estimated budget as total prompt size; expecting AST or document selection from the package graph; claiming schema validation proves agent behavior.
|
|
154
32
|
|
|
155
33
|
## Integration Notes
|
|
156
34
|
|
|
157
|
-
|
|
35
|
+
context-manager is a deprecated compatibility alias. engineering-workflow owns the lifecycle; security owns protected boundaries. packs.yaml and rules.yaml are reference data, not executable policy.
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ContextOS troubleshooting
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
-
|
|
3
|
+
- Stale projection: inspect edits in core/project sources, compile, export, and
|
|
4
|
+
verify export --check. Do not hand-edit generated artifacts.
|
|
5
|
+
- Missing skill: inspect installed manifests and resolver warnings; install only
|
|
6
|
+
the required catalog skill through supported tooling.
|
|
7
|
+
- Budget overflow: preserve mandatory safety guidance and reduce irrelevant
|
|
8
|
+
context; the budget is soft and entrypoint-only.
|
|
9
|
+
- Wrong risk or selection: supply relevant paths, inspect the actual operation,
|
|
10
|
+
and report a reproducible routing case. A resolver label is not an authority.
|
|
11
|
+
- Missing graph command: use resolve --json for workspace package evidence;
|
|
12
|
+
inspect source callers separately for symbol-level impact.
|