special-agents 0.3.7 → 0.4.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 +1 -1
- package/content/docs/features.md +1 -2
- package/content/rules/domain/ai-cost.md +3 -3
- package/content/rules/domain/ai-evals.md +2 -2
- package/content/rules/domain/ai-governance.md +2 -2
- package/content/rules/domain/ai-safety.md +2 -2
- package/content/rules/domain/data-governance.md +2 -2
- package/content/rules/domain/observability.md +2 -2
- package/content/rules/domain/scalability.md +2 -2
- package/content/rules/packs.index.yaml +12 -12
- package/content/rules/process/architecture.md +4 -4
- package/content/rules/process/business-docs.md +2 -2
- package/content/rules/process/project-docs.md +19 -19
- package/content/rules/process/release.md +2 -2
- package/content/rules/process/tickets.md +2 -2
- package/content/rules/templated/database.md +1 -1
- package/content/rules/templated/infra.md +1 -1
- package/dist/compile.d.ts +1 -1
- package/dist/compile.js +9 -5
- package/dist/content.d.ts +1 -0
- package/dist/content.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ emitCompiledBundles("./my-repo", {
|
|
|
40
40
|
|
|
41
41
|
## Rule packs
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
30 packs across four categories. Conditional packs are only included when the matching flag is on.
|
|
44
44
|
|
|
45
45
|
| Category | Packs | Condition |
|
|
46
46
|
|---|---|---|
|
package/content/docs/features.md
CHANGED
|
@@ -35,7 +35,6 @@ Use this document to track what the app does, who can use each feature, and what
|
|
|
35
35
|
|
|
36
36
|
## Future Ideas
|
|
37
37
|
|
|
38
|
-
Add future ideas to `
|
|
38
|
+
Add future ideas to `{{docsRoot}}/tickets.md`; summarize only major themes here.
|
|
39
39
|
|
|
40
40
|
- `<idea/theme>`
|
|
41
|
-
|
|
@@ -3,19 +3,19 @@ name: ai-cost
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "AI cost tracking and the correction/learning loop."
|
|
5
5
|
condition: ai
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## AI Cost Tracking And Learning Loop
|
|
9
9
|
|
|
10
10
|
- Include cost tracking throughout AI usage.
|
|
11
11
|
- Track cost per task for AI generations, including tokens, model/provider, retries, tool calls, retrieval, latency, and final success/failure status where available.
|
|
12
12
|
- Track other app operations that may create significant cost early or at scale, including cloud resources, queues, storage, external APIs, email/SMS, analytics, and heavy database workloads.
|
|
13
|
-
- Keep AI cost tracking and optimization notes updated in `
|
|
13
|
+
- Keep AI cost tracking and optimization notes updated in `{{docsRoot}}/ai-costs.md`.
|
|
14
14
|
- Record results of AI generation steps when appropriate so the project can learn from successes and failures.
|
|
15
15
|
- Plan a correction workflow for failed generations: generate suggested corrections, run QA on corrections, and record approved corrections with the failed generation.
|
|
16
16
|
- Auto-approve corrections only when correction and QA confidence are both very high and the risk level allows it.
|
|
17
17
|
- Require admin approval for lower-confidence, high-risk, or ambiguous corrections.
|
|
18
18
|
- Preserve approved corrections and failed generations in a structured format that could support future fine-tuning, evals, or custom model training.
|
|
19
|
-
- Document the journey toward custom model training in `
|
|
19
|
+
- Document the journey toward custom model training in `{{docsRoot}}/ai.md`, including data requirements, quality thresholds, privacy constraints, retention rules, estimated cost, and when training is worth it.
|
|
20
20
|
- During planning, consult the user about the AI learning-loop and custom-training approach. If the full setup would be too cumbersome or data-heavy, recommend a lighter approach.
|
|
21
21
|
|
|
@@ -3,7 +3,7 @@ name: ai-evals
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "Quality gates, confidence, evals, and examples for AI."
|
|
5
5
|
condition: ai
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## AI Quality, Confidence, And Evals
|
|
9
9
|
|
|
@@ -28,7 +28,7 @@ template: false
|
|
|
28
28
|
|
|
29
29
|
### Eval Suites
|
|
30
30
|
|
|
31
|
-
- Keep AI eval suites, golden examples, adversarial cases, and regression results updated in `
|
|
31
|
+
- Keep AI eval suites, golden examples, adversarial cases, and regression results updated in `{{docsRoot}}/ai-evals.md`.
|
|
32
32
|
- Maintain eval sets that cover: correct common cases, edge cases, known failure modes, adversarial inputs, and cases drawn from corrected production failures.
|
|
33
33
|
- Track AI failures, correction rates, confidence levels, approval outcomes, and quality trends.
|
|
34
34
|
- Promote prompt, parameter, or model changes only when required eval suites meet documented thresholds, or document the explicit user-approved reason for accepting the risk.
|
|
@@ -3,7 +3,7 @@ name: ai-governance
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "Model/provider and dataset governance."
|
|
5
5
|
condition: ai
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## AI Model And Dataset Governance
|
|
9
9
|
|
|
@@ -12,5 +12,5 @@ template: false
|
|
|
12
12
|
- Document dataset sources, consent, labeling process, quality thresholds, retention, access controls, and whether data may be used for evals, fine-tuning, or custom model training.
|
|
13
13
|
- Keep training/eval datasets versioned where practical.
|
|
14
14
|
- Do not use customer/user data for model training unless the data policy, consent, retention, security, and approval requirements are documented.
|
|
15
|
-
- Document model and dataset governance in `
|
|
15
|
+
- Document model and dataset governance in `{{docsRoot}}/ai.md` and `{{docsRoot}}/data-governance.md`.
|
|
16
16
|
|
|
@@ -3,7 +3,7 @@ name: ai-safety
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "Adversarial safety and abuse protection for AI features."
|
|
5
5
|
condition: ai
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## AI And LLM Safety
|
|
9
9
|
|
|
@@ -15,5 +15,5 @@ template: false
|
|
|
15
15
|
- Add AI abuse monitoring for suspicious prompts, repeated failures, high-cost usage, policy violations, and unusual generation patterns.
|
|
16
16
|
- Red-team AI features with prompt injection, jailbreak, data leakage, unsafe action, tool misuse, and cost-abuse cases before high-risk releases.
|
|
17
17
|
- Maintain an AI incident plan for harmful, wrong, private, expensive, abusive, or policy-violating outputs.
|
|
18
|
-
- Document AI safety controls, known risks, and escalation paths in `
|
|
18
|
+
- Document AI safety controls, known risks, and escalation paths in `{{docsRoot}}/ai.md` and `{{docsRoot}}/operations.md`.
|
|
19
19
|
|
|
@@ -3,7 +3,7 @@ name: data-governance
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "Data classification, retention, consent, and PII handling."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Data Governance
|
|
9
9
|
|
|
@@ -13,5 +13,5 @@ template: false
|
|
|
13
13
|
- Document consent requirements for user data, analytics, AI replay logs, eval datasets, and future model training.
|
|
14
14
|
- Use access controls for sensitive data and audit access where risk warrants it.
|
|
15
15
|
- Redact or tokenize PII and secrets before storing prompts, outputs, logs, traces, eval cases, or replay data unless explicitly approved and protected.
|
|
16
|
-
- Keep data-governance rules current in `
|
|
16
|
+
- Keep data-governance rules current in `{{docsRoot}}/data-governance.md`.
|
|
17
17
|
|
|
@@ -3,7 +3,7 @@ name: observability
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "Logging, metrics, dashboards, runbooks, and AI observability."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Observability And Operations
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ template: false
|
|
|
12
12
|
- Build visible status tracking for key workflows so users, admins, and operators can understand progress, failures, retries, and completion state.
|
|
13
13
|
- Add detailed observability for AI generation flows, including generation stages, model calls, retries, validation results, confidence, cost, latency, and approval status.
|
|
14
14
|
- Avoid logging secrets or sensitive user data.
|
|
15
|
-
- Document operational risks, runbooks, cost drivers, and monitoring expectations in `
|
|
15
|
+
- Document operational risks, runbooks, cost drivers, and monitoring expectations in `{{docsRoot}}/operations.md`, `{{docsRoot}}/business.md`, or `{{docsRoot}}/architecture.md` as appropriate.
|
|
16
16
|
- Maintain runbooks for common production failures and manual recovery steps.
|
|
17
17
|
- For new background jobs, queues, cron tasks, or integrations, document retry behavior, failure modes, and manual recovery steps.
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@ name: scalability
|
|
|
3
3
|
category: domain
|
|
4
4
|
description: "Scaling strategy across server, cloud, AI, frontend, and data."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Scalability And Performance
|
|
9
9
|
|
|
@@ -14,5 +14,5 @@ template: false
|
|
|
14
14
|
- For frontend work, watch bundle size, rendering cost, loading states, network waterfalls, and mobile performance.
|
|
15
15
|
- For cloud infrastructure, document scaling assumptions, capacity limits, deployment topology, regions, managed services, and expected bottlenecks.
|
|
16
16
|
- For AI/model usage, plan for provider limits, latency, concurrency, queueing, fallback behavior, cost controls, and model upgrade paths.
|
|
17
|
-
- Document meaningful scalability assumptions and known limits in `
|
|
17
|
+
- Document meaningful scalability assumptions and known limits in `{{docsRoot}}/scalability.md`.
|
|
18
18
|
|
|
@@ -22,13 +22,13 @@ packs:
|
|
|
22
22
|
category: process
|
|
23
23
|
path: process/project-docs.md
|
|
24
24
|
condition: always
|
|
25
|
-
template:
|
|
25
|
+
template: true
|
|
26
26
|
order: 4000
|
|
27
27
|
- name: tickets
|
|
28
28
|
category: process
|
|
29
29
|
path: process/tickets.md
|
|
30
30
|
condition: always
|
|
31
|
-
template:
|
|
31
|
+
template: true
|
|
32
32
|
supersededByForeman: true
|
|
33
33
|
order: 5000
|
|
34
34
|
- name: tdd
|
|
@@ -71,7 +71,7 @@ packs:
|
|
|
71
71
|
category: domain
|
|
72
72
|
path: domain/scalability.md
|
|
73
73
|
condition: always
|
|
74
|
-
template:
|
|
74
|
+
template: true
|
|
75
75
|
order: 12000
|
|
76
76
|
- name: infra
|
|
77
77
|
category: templated
|
|
@@ -89,7 +89,7 @@ packs:
|
|
|
89
89
|
category: domain
|
|
90
90
|
path: domain/data-governance.md
|
|
91
91
|
condition: always
|
|
92
|
-
template:
|
|
92
|
+
template: true
|
|
93
93
|
order: 15000
|
|
94
94
|
- name: security
|
|
95
95
|
category: domain
|
|
@@ -101,13 +101,13 @@ packs:
|
|
|
101
101
|
category: domain
|
|
102
102
|
path: domain/ai-safety.md
|
|
103
103
|
condition: ai
|
|
104
|
-
template:
|
|
104
|
+
template: true
|
|
105
105
|
order: 17000
|
|
106
106
|
- name: ai-governance
|
|
107
107
|
category: domain
|
|
108
108
|
path: domain/ai-governance.md
|
|
109
109
|
condition: ai
|
|
110
|
-
template:
|
|
110
|
+
template: true
|
|
111
111
|
order: 18000
|
|
112
112
|
- name: robustness
|
|
113
113
|
category: domain
|
|
@@ -119,7 +119,7 @@ packs:
|
|
|
119
119
|
category: domain
|
|
120
120
|
path: domain/ai-evals.md
|
|
121
121
|
condition: ai
|
|
122
|
-
template:
|
|
122
|
+
template: true
|
|
123
123
|
order: 20000
|
|
124
124
|
- name: ai-reproducibility
|
|
125
125
|
category: domain
|
|
@@ -131,7 +131,7 @@ packs:
|
|
|
131
131
|
category: domain
|
|
132
132
|
path: domain/ai-cost.md
|
|
133
133
|
condition: ai
|
|
134
|
-
template:
|
|
134
|
+
template: true
|
|
135
135
|
order: 22000
|
|
136
136
|
- name: ai-batch-testing
|
|
137
137
|
category: domain
|
|
@@ -143,7 +143,7 @@ packs:
|
|
|
143
143
|
category: process
|
|
144
144
|
path: process/release.md
|
|
145
145
|
condition: always
|
|
146
|
-
template:
|
|
146
|
+
template: true
|
|
147
147
|
order: 24000
|
|
148
148
|
- name: accessibility
|
|
149
149
|
category: domain
|
|
@@ -155,19 +155,19 @@ packs:
|
|
|
155
155
|
category: domain
|
|
156
156
|
path: domain/observability.md
|
|
157
157
|
condition: always
|
|
158
|
-
template:
|
|
158
|
+
template: true
|
|
159
159
|
order: 26000
|
|
160
160
|
- name: business-docs
|
|
161
161
|
category: process
|
|
162
162
|
path: process/business-docs.md
|
|
163
163
|
condition: always
|
|
164
|
-
template:
|
|
164
|
+
template: true
|
|
165
165
|
order: 27000
|
|
166
166
|
- name: architecture
|
|
167
167
|
category: process
|
|
168
168
|
path: process/architecture.md
|
|
169
169
|
condition: always
|
|
170
|
-
template:
|
|
170
|
+
template: true
|
|
171
171
|
order: 28000
|
|
172
172
|
- name: definition-of-done
|
|
173
173
|
category: base
|
|
@@ -3,12 +3,12 @@ name: architecture
|
|
|
3
3
|
category: process
|
|
4
4
|
description: "Architecture digest and ADR/decision-history discipline."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Architecture And Decisions
|
|
9
9
|
|
|
10
|
-
- Keep `
|
|
11
|
-
- Add ADRs in `
|
|
12
|
-
- Keep `
|
|
10
|
+
- Keep `{{docsRoot}}/architecture.md` as a digest of how the app works now.
|
|
11
|
+
- Add ADRs in `{{docsRoot}}/decisions/` for choices that will matter later, including stack changes, major dependencies, database design, auth model, billing model, hosting, integrations, and AI/provider choices.
|
|
12
|
+
- Keep `{{docsRoot}}/decisions/README.md` updated as the decision-making history index.
|
|
13
13
|
- ADRs should be short: context, decision, alternatives considered, consequences, date.
|
|
14
14
|
|
|
@@ -3,11 +3,11 @@ name: business-docs
|
|
|
3
3
|
category: process
|
|
4
4
|
description: "Keep business assumptions, costs, and risks current."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Business Documentation
|
|
9
9
|
|
|
10
|
-
- Keep `
|
|
10
|
+
- Keep `{{docsRoot}}/business.md` current with product assumptions, cost drivers, vendor/service pricing notes, revenue/pricing ideas, operational risks, and open business questions.
|
|
11
11
|
- When a change affects cost, pricing, packaging, user roles, admin effort, compliance, support load, AI/model usage, or operational complexity, update the business docs.
|
|
12
12
|
- If exact pricing or costs require current external information, verify them before documenting.
|
|
13
13
|
|
|
@@ -3,31 +3,31 @@ name: project-docs
|
|
|
3
3
|
category: process
|
|
4
4
|
description: "The standard set of project documents to create and maintain."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Standard Project Documents
|
|
9
9
|
|
|
10
10
|
Create and maintain these documents unless the repository has equivalent files:
|
|
11
11
|
|
|
12
12
|
- `README.md`: developer install, setup, environment variables, run, test, build, and deploy basics.
|
|
13
|
-
- `
|
|
14
|
-
- `
|
|
15
|
-
- `
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
- `
|
|
26
|
-
- `
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
30
|
-
- `
|
|
13
|
+
- `{{docsRoot}}/architecture.md`: architecture digest, major modules, data flow, integrations, infrastructure, and tradeoffs.
|
|
14
|
+
- `{{docsRoot}}/features.md`: feature digest, user-facing capabilities, roles, permissions, and important workflows.
|
|
15
|
+
- `{{docsRoot}}/api.md` or generated API docs: API overview and links to OpenAPI, Swagger, JSDoc, Typedoc, or equivalent generated references.
|
|
16
|
+
- `{{docsRoot}}/users.md`: normal user documentation.
|
|
17
|
+
- `{{docsRoot}}/admins.md`: admin/operator documentation.
|
|
18
|
+
- `{{docsRoot}}/business.md`: business-level notes, feature rationale, pricing/costs, vendor costs, risk areas, operational concerns, and things to watch.
|
|
19
|
+
- `{{docsRoot}}/operations.md`: deployment notes, monitoring, runbooks, incident response, backups, and recovery steps.
|
|
20
|
+
- `{{docsRoot}}/security.md`: security model, threat model, auth, permissions, secrets, abuse controls, and incident response.
|
|
21
|
+
- `{{docsRoot}}/data-governance.md`: data classification, PII handling, retention, deletion/export, consent, and training-data rules.
|
|
22
|
+
- `{{docsRoot}}/local-cloud.md`: local runtime, cloud runtime, parity expectations, environment differences, and deployment notes.
|
|
23
|
+
- `{{docsRoot}}/scalability.md`: scaling strategy for server, cloud, AI/model usage, frontend, databases, and overall architecture.
|
|
24
|
+
- `{{docsRoot}}/ai.md`: AI workflows, model/provider choices, prompts, evals, safety controls, cost tracking, replayability, and training-data strategy when the app uses AI.
|
|
25
|
+
- `{{docsRoot}}/ai-evals.md`: AI eval suites, golden examples, adversarial cases, quality gates, and prompt/model regression results.
|
|
26
|
+
- `{{docsRoot}}/ai-costs.md`: AI cost tracking, cost per task, provider/model costs, high-cost workflows, and optimization notes.
|
|
27
|
+
- `{{docsRoot}}/tickets.md`: ticket log, roadmap, backlog, status, acceptance criteria, and future ideas.
|
|
28
|
+
- `{{docsRoot}}/decisions/`: ADRs and decision history for meaningful architecture, product, data, vendor, AI, or cost decisions.
|
|
29
|
+
- `{{docsRoot}}/decisions/README.md`: decision-making history index with links to ADRs and a short status summary.
|
|
30
|
+
- `{{docsRoot}}/release-checklist.md`: release readiness, versioning, migrations, rollback, smoke tests, and post-release checks.
|
|
31
31
|
- `CHANGELOG.md`: notable user-facing, API, migration, and operational changes.
|
|
32
32
|
- `.env.example`: documented environment variables with safe placeholder values.
|
|
33
33
|
|
|
@@ -3,14 +3,14 @@ name: release
|
|
|
3
3
|
category: process
|
|
4
4
|
description: "Changelog, semver, release checklist, and post-release notes."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
---
|
|
8
8
|
## Release, Versioning, And Change Management
|
|
9
9
|
|
|
10
10
|
- Maintain `CHANGELOG.md` for notable user-facing, API, migration, security, AI/model, and operational changes.
|
|
11
11
|
- Use semantic versioning where it applies to published apps, APIs, packages, SDKs, or user-visible releases.
|
|
12
12
|
- Document breaking changes, deprecations, migration steps, rollback steps, and user/admin impact.
|
|
13
|
-
- Use `
|
|
13
|
+
- Use `{{docsRoot}}/release-checklist.md` before releases that affect users, production data, public APIs, infrastructure, billing, auth, or AI behavior.
|
|
14
14
|
- Include smoke tests, monitoring checks, migration checks, environment-variable checks, documentation updates, and rollback readiness in release planning.
|
|
15
15
|
- After release, document incidents, regressions, follow-up work, and any release-process improvements.
|
|
16
16
|
|
|
@@ -3,12 +3,12 @@ name: tickets
|
|
|
3
3
|
category: process
|
|
4
4
|
description: "Ticket log expectations when no external tracker is configured."
|
|
5
5
|
condition: always
|
|
6
|
-
template:
|
|
6
|
+
template: true
|
|
7
7
|
supersededByForeman: true
|
|
8
8
|
---
|
|
9
9
|
## Ticket Tracking
|
|
10
10
|
|
|
11
|
-
- Maintain `
|
|
11
|
+
- Maintain `{{docsRoot}}/tickets.md` as the source of truth if no external tracker is configured.
|
|
12
12
|
- Break work into epics, stories, and implementation tickets where useful.
|
|
13
13
|
- Every ticket should include: ID, title, status, priority, user/business value, acceptance criteria, implementation notes, test expectations, and links to related docs or code when available.
|
|
14
14
|
- Valid statuses: `Backlog`, `Ready`, `In Progress`, `Blocked`, `In Review`, `Done`, `Won't Do`.
|
|
@@ -12,5 +12,5 @@ template: true
|
|
|
12
12
|
- Keep migrations reviewable and, where practical, reversible.
|
|
13
13
|
- Update seed data, fixtures, and `.env.example` when schema or setup requirements change.
|
|
14
14
|
- Validate data at system boundaries and before persistence.
|
|
15
|
-
- Document important entities and relationships in `
|
|
15
|
+
- Document important entities and relationships in `{{docsRoot}}/architecture.md`.
|
|
16
16
|
|
|
@@ -13,6 +13,6 @@ template: true
|
|
|
13
13
|
- Keep `.env.example`, setup docs, seed data, and local database instructions current.
|
|
14
14
|
- Define cloud infrastructure with Infrastructure as Code such as AWS CDK, Terraform, Pulumi, or CloudFormation unless there is a documented reason not to.
|
|
15
15
|
- Avoid manual cloud console changes for durable infrastructure. If manual changes are unavoidable, document them and add follow-up work to codify them.
|
|
16
|
-
- Document {{cloud}} account/region assumptions, IAM model, networking, secrets, storage, databases, queues, observability, and deployment flow in `
|
|
16
|
+
- Document {{cloud}} account/region assumptions, IAM model, networking, secrets, storage, databases, queues, observability, and deployment flow in `{{docsRoot}}/local-cloud.md`, `{{docsRoot}}/architecture.md`, or `{{docsRoot}}/operations.md`.
|
|
17
17
|
- Consult the user when local/cloud runtime expectations, hosting constraints, or infrastructure ownership are unclear.
|
|
18
18
|
|
package/dist/compile.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare function buildConditionsHeader(flags: {
|
|
|
53
53
|
usesAI: boolean;
|
|
54
54
|
hasFrontend: boolean;
|
|
55
55
|
runsInCloud: boolean;
|
|
56
|
-
}): string;
|
|
56
|
+
}, docsRoot?: string): string;
|
|
57
57
|
/**
|
|
58
58
|
* Write `<targetDir>/AGENTS.md` — the flattened Codex rules document.
|
|
59
59
|
* Format: one-line conditions header + preamble + all packs rendered with defaults.
|
package/dist/compile.js
CHANGED
|
@@ -19,7 +19,10 @@ import { loadAllSkills, SKILLS_DIR } from "./skills.js";
|
|
|
19
19
|
export const CUSTOM_ARTIFACTS_NOTE = "Custom Rafi skills or agents can replace the defaults by setting `artifact_source: existing` and editing their paths in `rafi-config.yaml`.\n";
|
|
20
20
|
/** Render one pack body, substituting `{{vars}}` and resolving `{{#if flag}}` blocks. */
|
|
21
21
|
export function renderPackBody(pack, defaults) {
|
|
22
|
-
return render(pack.body, {
|
|
22
|
+
return render(pack.body, {
|
|
23
|
+
vars: { ...defaults.stack, docsRoot: defaults.docsRoot ?? "docs" },
|
|
24
|
+
flags: defaults.flags,
|
|
25
|
+
});
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
28
|
* The full flattened rules doc: preamble + all packs (index order), rendered.
|
|
@@ -61,10 +64,11 @@ export function getAgent(role, opts = {}) {
|
|
|
61
64
|
* are active. Written at the top of `AGENTS.md` and `CLAUDE.md` so the choice
|
|
62
65
|
* is never invisible.
|
|
63
66
|
*/
|
|
64
|
-
export function buildConditionsHeader(flags) {
|
|
67
|
+
export function buildConditionsHeader(flags, docsRoot = "docs") {
|
|
65
68
|
return (`# rafi: ai=${flags.usesAI ? "on" : "off"}` +
|
|
66
69
|
` frontend=${flags.hasFrontend ? "on" : "off"}` +
|
|
67
|
-
` cloud=${flags.runsInCloud ? "on" : "off"}
|
|
70
|
+
` cloud=${flags.runsInCloud ? "on" : "off"}` +
|
|
71
|
+
` docs=${docsRoot}\n`);
|
|
68
72
|
}
|
|
69
73
|
/**
|
|
70
74
|
* Write `<targetDir>/AGENTS.md` — the flattened Codex rules document.
|
|
@@ -81,12 +85,12 @@ export function emitClaudeMd(targetDir, opts = {}) {
|
|
|
81
85
|
}
|
|
82
86
|
export function renderAgentsMd(opts = {}) {
|
|
83
87
|
const defaults = opts.defaults ?? loadDefaults();
|
|
84
|
-
const header = buildConditionsHeader(defaults.flags);
|
|
88
|
+
const header = buildConditionsHeader(defaults.flags, defaults.docsRoot ?? "docs");
|
|
85
89
|
return header + composeRulesMarkdown({ defaults });
|
|
86
90
|
}
|
|
87
91
|
export function renderClaudeMd(opts = {}) {
|
|
88
92
|
const defaults = opts.defaults ?? loadDefaults();
|
|
89
|
-
const header = buildConditionsHeader(defaults.flags);
|
|
93
|
+
const header = buildConditionsHeader(defaults.flags, defaults.docsRoot ?? "docs");
|
|
90
94
|
return header + "@AGENTS.md\n\n" + CUSTOM_ARTIFACTS_NOTE;
|
|
91
95
|
}
|
|
92
96
|
/**
|
package/dist/content.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function parseRulePack(raw: string): RulePack;
|
|
|
7
7
|
export interface Defaults {
|
|
8
8
|
stack: Record<string, string>;
|
|
9
9
|
flags: Record<string, boolean>;
|
|
10
|
+
docsRoot?: string;
|
|
10
11
|
}
|
|
11
12
|
/** Read content/defaults.yaml. */
|
|
12
13
|
export declare function loadDefaults(): Defaults;
|
package/dist/content.js
CHANGED
|
@@ -27,7 +27,8 @@ export function parseRulePack(raw) {
|
|
|
27
27
|
}
|
|
28
28
|
/** Read content/defaults.yaml. */
|
|
29
29
|
export function loadDefaults() {
|
|
30
|
-
|
|
30
|
+
const defaults = parseYaml(readFileSync(join(CONTENT_DIR, "defaults.yaml"), "utf8"));
|
|
31
|
+
return { ...defaults, docsRoot: defaults.docsRoot ?? "docs" };
|
|
31
32
|
}
|
|
32
33
|
/** The flattened-rules-doc preamble (everything before the first section). */
|
|
33
34
|
export function loadPreamble() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "special-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Rafi library: composable best-practice rules, skills, and agents for Claude Code and Codex.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"node": ">=20"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"rafi-spec": "0.
|
|
39
|
+
"rafi-spec": "0.4.0",
|
|
40
40
|
"ajv": "^8.20.0",
|
|
41
41
|
"yaml": "^2.5.1"
|
|
42
42
|
},
|