special-agents 0.1.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 +69 -0
- package/content/agents/builder.yaml +25 -0
- package/content/agents/planner.yaml +13 -0
- package/content/agents/qa.yaml +16 -0
- package/content/agents/ticket-maker.yaml +11 -0
- package/content/defaults.yaml +13 -0
- package/content/docs/README.md +42 -0
- package/content/docs/admins.md +46 -0
- package/content/docs/ai-costs.md +38 -0
- package/content/docs/ai-evals.md +55 -0
- package/content/docs/ai.md +141 -0
- package/content/docs/api.md +51 -0
- package/content/docs/architecture.md +61 -0
- package/content/docs/business.md +49 -0
- package/content/docs/data-governance.md +67 -0
- package/content/docs/decisions/0000-template.md +29 -0
- package/content/docs/decisions/README.md +30 -0
- package/content/docs/docs.index.yaml +25 -0
- package/content/docs/features.md +41 -0
- package/content/docs/local-cloud.md +58 -0
- package/content/docs/operations.md +69 -0
- package/content/docs/release-checklist.md +56 -0
- package/content/docs/scalability.md +81 -0
- package/content/docs/security.md +82 -0
- package/content/docs/tickets.md +45 -0
- package/content/docs/users.md +43 -0
- package/content/preamble.md +13 -0
- package/content/rules/base/code-quality.md +20 -0
- package/content/rules/base/core.md +17 -0
- package/content/rules/base/definition-of-done.md +21 -0
- package/content/rules/base/git-safety.md +16 -0
- package/content/rules/base/response-expectations.md +18 -0
- package/content/rules/domain/accessibility.md +14 -0
- package/content/rules/domain/ai-cost.md +21 -0
- package/content/rules/domain/ai-evals.md +25 -0
- package/content/rules/domain/ai-governance.md +16 -0
- package/content/rules/domain/ai-reproducibility.md +19 -0
- package/content/rules/domain/ai-safety.md +19 -0
- package/content/rules/domain/data-governance.md +17 -0
- package/content/rules/domain/observability.md +18 -0
- package/content/rules/domain/robustness.md +21 -0
- package/content/rules/domain/scalability.md +18 -0
- package/content/rules/domain/security.md +28 -0
- package/content/rules/packs.index.yaml +177 -0
- package/content/rules/process/api-docs.md +16 -0
- package/content/rules/process/architecture.md +14 -0
- package/content/rules/process/business-docs.md +13 -0
- package/content/rules/process/ci.md +18 -0
- package/content/rules/process/dependencies.md +17 -0
- package/content/rules/process/project-docs.md +35 -0
- package/content/rules/process/release.md +16 -0
- package/content/rules/process/tdd.md +16 -0
- package/content/rules/process/testing.md +28 -0
- package/content/rules/process/tickets.md +17 -0
- package/content/rules/templated/database.md +16 -0
- package/content/rules/templated/infra.md +18 -0
- package/content/rules/templated/stack.md +19 -0
- package/content/skills/better-sqlite3-rebuild/SKILL.md +14 -0
- package/content/skills/grill-me/SKILL.md +10 -0
- package/content/skills/improve-codebase-architecture/REFERENCE.md +78 -0
- package/content/skills/improve-codebase-architecture/SKILL.md +76 -0
- package/content/skills/prd-to-issues/SKILL.md +92 -0
- package/content/skills/tdd/SKILL.md +107 -0
- package/content/skills/tdd/deep-modules.md +33 -0
- package/content/skills/tdd/interface-design.md +31 -0
- package/content/skills/tdd/mocking.md +59 -0
- package/content/skills/tdd/refactoring.md +10 -0
- package/content/skills/tdd/tests.md +61 -0
- package/content/skills/write-a-prd/SKILL.md +74 -0
- package/dist/agents.d.ts +11 -0
- package/dist/agents.js +31 -0
- package/dist/compile.d.ts +79 -0
- package/dist/compile.js +113 -0
- package/dist/content.d.ts +49 -0
- package/dist/content.js +73 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/resolve.d.ts +46 -0
- package/dist/resolve.js +54 -0
- package/dist/skills.d.ts +11 -0
- package/dist/skills.js +45 -0
- package/dist/template.d.ts +22 -0
- package/dist/template.js +34 -0
- package/node_modules/rafi-spec/dist/index.d.ts +4 -0
- package/node_modules/rafi-spec/dist/index.js +4 -0
- package/node_modules/rafi-spec/dist/schemas.d.ts +185 -0
- package/node_modules/rafi-spec/dist/schemas.js +95 -0
- package/node_modules/rafi-spec/dist/types.d.ts +111 -0
- package/node_modules/rafi-spec/dist/types.js +6 -0
- package/node_modules/rafi-spec/dist/validate.d.ts +16 -0
- package/node_modules/rafi-spec/dist/validate.js +40 -0
- package/node_modules/rafi-spec/package.json +35 -0
- package/node_modules/rafi-spec/src/index.ts +19 -0
- package/node_modules/rafi-spec/src/schemas.ts +102 -0
- package/node_modules/rafi-spec/src/types.ts +134 -0
- package/node_modules/rafi-spec/src/validate.ts +60 -0
- package/package.json +39 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: definition-of-done
|
|
3
|
+
category: base
|
|
4
|
+
description: "What must be true before a change is considered complete."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Definition Of Done
|
|
9
|
+
|
|
10
|
+
A change is not done until:
|
|
11
|
+
|
|
12
|
+
- The requested behavior is implemented.
|
|
13
|
+
- The agent has reviewed this rule file, confirmed the change complies with it, and prepared a concise rule-compliance result for the user, except for items that are not yet applicable during initial project buildout.
|
|
14
|
+
- Relevant tests are added or updated.
|
|
15
|
+
- Relevant tests and quality checks pass, or any inability to run them is reported.
|
|
16
|
+
- API docs are updated when contracts change.
|
|
17
|
+
- Developer, user, admin, business, ticket, and architecture docs are updated where relevant.
|
|
18
|
+
- Ticket status and future follow-ups are updated.
|
|
19
|
+
- New environment variables, migrations, dependencies, and operational steps are documented.
|
|
20
|
+
- The final response explains what changed, what tests ran, and any remaining risks.
|
|
21
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-safety
|
|
3
|
+
category: base
|
|
4
|
+
description: "Protect user changes and avoid destructive git operations."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Git And Workspace Safety
|
|
9
|
+
|
|
10
|
+
- Before editing, inspect the repository state when practical and avoid overwriting user changes.
|
|
11
|
+
- Treat uncommitted changes as user-owned unless the agent made them in the current task.
|
|
12
|
+
- Never discard, reset, overwrite, or revert user changes unless the user explicitly asks.
|
|
13
|
+
- Do not run destructive git commands such as hard reset, forced checkout, branch deletion, or history rewriting unless the user explicitly asks.
|
|
14
|
+
- Do not commit, push, tag, merge, rebase, or open pull requests unless the user asks.
|
|
15
|
+
- Keep changes scoped to the requested work. If a cleanup or refactor is useful but not required, note it as follow-up work.
|
|
16
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: response-expectations
|
|
3
|
+
category: base
|
|
4
|
+
description: "What every final response should include."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Agent Response Expectations
|
|
9
|
+
|
|
10
|
+
- Be concise and concrete.
|
|
11
|
+
- In final responses, include:
|
|
12
|
+
- Code changes made.
|
|
13
|
+
- Tests/checks run and whether they passed.
|
|
14
|
+
- Documentation updated.
|
|
15
|
+
- Rule compliance check result, including any rules not yet applicable during initial buildout.
|
|
16
|
+
- Tests changed, explained simply, when applicable.
|
|
17
|
+
- Follow-up tickets added, when applicable.
|
|
18
|
+
- Do not overwhelm the user with implementation noise unless they ask for it.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: accessibility
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Accessible, resilient UI and product quality."
|
|
5
|
+
condition: frontend
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Accessibility, UX, And Product Quality
|
|
9
|
+
|
|
10
|
+
- Build accessible UI by default: semantic markup, keyboard navigation, focus states, labels, contrast, and screen-reader-friendly structure.
|
|
11
|
+
- Keep user workflows complete, understandable, and resilient to loading, empty, error, and permission states.
|
|
12
|
+
- Do not ship user-facing changes without updating relevant user/admin docs.
|
|
13
|
+
- Preserve existing design system conventions unless the task calls for a design change.
|
|
14
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-cost
|
|
3
|
+
category: domain
|
|
4
|
+
description: "AI cost tracking and the correction/learning loop."
|
|
5
|
+
condition: ai
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## AI Cost Tracking And Learning Loop
|
|
9
|
+
|
|
10
|
+
- Include cost tracking throughout AI usage.
|
|
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
|
+
- 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 `docs/ai-costs.md`.
|
|
14
|
+
- Record results of AI generation steps when appropriate so the project can learn from successes and failures.
|
|
15
|
+
- Plan a correction workflow for failed generations: generate suggested corrections, run QA on corrections, and record approved corrections with the failed generation.
|
|
16
|
+
- Auto-approve corrections only when correction and QA confidence are both very high and the risk level allows it.
|
|
17
|
+
- Require admin approval for lower-confidence, high-risk, or ambiguous corrections.
|
|
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 `docs/ai.md`, including data requirements, quality thresholds, privacy constraints, retention rules, estimated cost, and when training is worth it.
|
|
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
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-evals
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Quality gates, confidence, evals, and examples for AI."
|
|
5
|
+
condition: ai
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## AI Quality, Confidence, And Evals
|
|
9
|
+
|
|
10
|
+
- Always plan AI generation workflows for high-confidence outputs, not just plausible outputs.
|
|
11
|
+
- Define quality gates, confidence scoring, QA checks, and acceptance thresholds for AI-generated results.
|
|
12
|
+
- Assume the project will include custom QA steps for important AI generations.
|
|
13
|
+
- When an AI generation is important or user-facing, include tests, evals, review workflows, or human approval steps that match the risk level.
|
|
14
|
+
- For prompts used in AI generation steps, QA steps, correction steps, and other relevant AI uses, instruct the model to check its work three times by default.
|
|
15
|
+
- Make the number of model self-checks configurable.
|
|
16
|
+
- Make extra model self-checking toggleable so it can be disabled when cost, latency, or workflow needs require it.
|
|
17
|
+
- During planning, consult the user about where work-checking prompts should be used, how many checks are appropriate, and when extra checks may be turned off.
|
|
18
|
+
- When using AI generation, start with at least one correct or top-quality example, and prefer many high-quality examples.
|
|
19
|
+
- Use correct/high-quality examples during AI generation where they improve quality.
|
|
20
|
+
- During planning, consult the user on which AI generation stages should use examples.
|
|
21
|
+
- Build the ability to toggle the use of correct/high-quality examples at AI generation steps where practical.
|
|
22
|
+
- Track AI failures, correction rates, confidence levels, approval outcomes, and quality trends.
|
|
23
|
+
- Keep AI eval suites, golden examples, adversarial cases, and regression results updated in `docs/ai-evals.md`.
|
|
24
|
+
- Promote prompt or model changes only when required eval suites meet documented thresholds, or document the explicit user-approved reason for accepting the risk.
|
|
25
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-governance
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Model/provider and dataset governance."
|
|
5
|
+
condition: ai
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## AI Model And Dataset Governance
|
|
9
|
+
|
|
10
|
+
- Document approved AI models/providers, the reason each is used, fallback models, and model-change approval rules.
|
|
11
|
+
- Treat model changes as product changes. Run relevant evals and document quality, cost, latency, and safety impact before promoting a new model.
|
|
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
|
+
- Keep training/eval datasets versioned where practical.
|
|
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 `docs/ai.md` and `docs/data-governance.md`.
|
|
16
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-reproducibility
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Replayability, prompt versioning, and prompt tuning."
|
|
5
|
+
condition: ai
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## AI Reproducibility, Replayability, And Prompt Tuning
|
|
9
|
+
|
|
10
|
+
- For anything involving AI, include reproducibility and replayability by default.
|
|
11
|
+
- Record enough information to replay meaningful AI generations: prompt version, rendered prompt, input data references, model/provider, parameters, tool calls, retrieval context, output, validation results, cost, latency, timestamps, and user/admin decisions.
|
|
12
|
+
- Do not store sensitive prompt, input, or output data for replay or training unless privacy, consent, retention, and access controls are documented and approved.
|
|
13
|
+
- Version prompts and keep a prompt change history.
|
|
14
|
+
- Treat prompts as product logic: review them, test them, document their purpose, and connect changes to eval results.
|
|
15
|
+
- Maintain eval sets with golden examples, edge cases, failure cases, and adversarial cases.
|
|
16
|
+
- Prefer structured prompt inputs and structured model outputs where practical.
|
|
17
|
+
- Support prompt rollback when a prompt change reduces quality.
|
|
18
|
+
- Track prompt experiments, model changes, temperature/parameter changes, example changes, and their measured impact.
|
|
19
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-safety
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Adversarial safety and abuse protection for AI features."
|
|
5
|
+
condition: ai
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## AI And LLM Safety
|
|
9
|
+
|
|
10
|
+
- For anything using LLMs or AI generation, include adversarial safety planning and protection against nefarious use.
|
|
11
|
+
- During planning for AI features, consult the user on enterprise-level AI safety practices appropriate for the app.
|
|
12
|
+
- Protect against prompt injection, jailbreak attempts, data exfiltration, tool misuse, unsafe generated actions, and hidden instructions in user-supplied content.
|
|
13
|
+
- Treat model output as untrusted. Validate, constrain, and review AI output before it affects users, data, money, permissions, external systems, or business-critical workflows.
|
|
14
|
+
- Use content safety checks, allow/deny rules, scoped tools, permission boundaries, and human review where risk warrants it.
|
|
15
|
+
- Add AI abuse monitoring for suspicious prompts, repeated failures, high-cost usage, policy violations, and unusual generation patterns.
|
|
16
|
+
- Red-team AI features with prompt injection, jailbreak, data leakage, unsafe action, tool misuse, and cost-abuse cases before high-risk releases.
|
|
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 `docs/ai.md` and `docs/operations.md`.
|
|
19
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: data-governance
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Data classification, retention, consent, and PII handling."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Data Governance
|
|
9
|
+
|
|
10
|
+
- Classify data by sensitivity, including public, internal, confidential, PII, credentials/secrets, regulated data, and training/eval data.
|
|
11
|
+
- Collect and retain the minimum data needed for the product, operations, safety, and legal requirements.
|
|
12
|
+
- Document data retention, deletion, export, backup, and recovery expectations.
|
|
13
|
+
- Document consent requirements for user data, analytics, AI replay logs, eval datasets, and future model training.
|
|
14
|
+
- Use access controls for sensitive data and audit access where risk warrants it.
|
|
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 `docs/data-governance.md`.
|
|
17
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: observability
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Logging, metrics, dashboards, runbooks, and AI observability."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Observability And Operations
|
|
9
|
+
|
|
10
|
+
- Add useful logging, monitoring, metrics, alerts, and health checks for production-relevant services.
|
|
11
|
+
- Plan for Grafana-compatible dashboards or an equivalent observability dashboard stack unless the project chooses another monitoring platform.
|
|
12
|
+
- Build visible status tracking for key workflows so users, admins, and operators can understand progress, failures, retries, and completion state.
|
|
13
|
+
- Add detailed observability for AI generation flows, including generation stages, model calls, retries, validation results, confidence, cost, latency, and approval status.
|
|
14
|
+
- Avoid logging secrets or sensitive user data.
|
|
15
|
+
- Document operational risks, runbooks, cost drivers, and monitoring expectations in `docs/operations.md`, `docs/business.md`, or `docs/architecture.md` as appropriate.
|
|
16
|
+
- Maintain runbooks for common production failures and manual recovery steps.
|
|
17
|
+
- For new background jobs, queues, cron tasks, or integrations, document retry behavior, failure modes, and manual recovery steps.
|
|
18
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: robustness
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Resilient workflows, transactions, health checks, backups."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Robustness And Reliability
|
|
9
|
+
|
|
10
|
+
- Design important workflows to handle loading, empty, error, timeout, retry, and partial-failure states.
|
|
11
|
+
- Use transactions for multi-step database writes that must succeed or fail together.
|
|
12
|
+
- Make background jobs idempotent where practical so retries do not duplicate side effects.
|
|
13
|
+
- Add timeouts, retries with backoff, and circuit-breaker-style protections around external services where appropriate.
|
|
14
|
+
- Use feature flags or staged rollout controls for risky releases where practical.
|
|
15
|
+
- Validate configuration at startup and fail with clear errors when required settings are missing.
|
|
16
|
+
- Use database constraints and application-level validation for important invariants.
|
|
17
|
+
- Add health checks for services and readiness checks for dependencies.
|
|
18
|
+
- Preserve backward compatibility for public APIs unless a breaking change is intentional and documented.
|
|
19
|
+
- Plan for backups, automated or scheduled restore testing, migrations, and rollback paths for production data.
|
|
20
|
+
- Maintain a release checklist covering migrations, environment variables, generated docs, monitoring, smoke tests, rollback steps, and user/admin documentation.
|
|
21
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scalability
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Scaling strategy across server, cloud, AI, frontend, and data."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Scalability And Performance
|
|
9
|
+
|
|
10
|
+
- Plan for scalability across the server, cloud infrastructure, AI/model usage, frontend, databases, and total app architecture.
|
|
11
|
+
- Keep services stateless where practical so they can scale horizontally.
|
|
12
|
+
- Use pagination, filtering, caching, batching, queues, background jobs, and rate limits where they reduce load or improve user experience.
|
|
13
|
+
- Design database schemas, indexes, constraints, and query patterns with expected growth in mind.
|
|
14
|
+
- For frontend work, watch bundle size, rendering cost, loading states, network waterfalls, and mobile performance.
|
|
15
|
+
- For cloud infrastructure, document scaling assumptions, capacity limits, deployment topology, regions, managed services, and expected bottlenecks.
|
|
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 `docs/scalability.md`.
|
|
18
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security
|
|
3
|
+
category: domain
|
|
4
|
+
description: "Security, privacy, and compliance baseline."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Security, Privacy, And Compliance
|
|
9
|
+
|
|
10
|
+
- Never commit secrets, credentials, tokens, private keys, or real user data.
|
|
11
|
+
- Use environment variables or secret managers for sensitive configuration.
|
|
12
|
+
- Apply least privilege to permissions, tokens, database access, and admin workflows.
|
|
13
|
+
- Require authentication and authorization checks on server-side boundaries, not only in the UI.
|
|
14
|
+
- Validate and sanitize user input.
|
|
15
|
+
- Use parameterized queries or trusted ORM/query-builder APIs. Do not build SQL with string concatenation.
|
|
16
|
+
- Keep dependencies current and remove unused dependencies.
|
|
17
|
+
- Scan dependencies for known vulnerabilities and address meaningful findings.
|
|
18
|
+
- Use secure defaults for cookies, sessions, CORS, headers, rate limits, password handling, and token expiration.
|
|
19
|
+
- Store passwords only with proven password hashing such as Argon2 or bcrypt. Never store plain-text passwords.
|
|
20
|
+
- Encrypt sensitive data in transit and at rest where appropriate.
|
|
21
|
+
- Protect against common web risks such as injection, XSS, CSRF, auth bypass, insecure direct object references, and unsafe file handling.
|
|
22
|
+
- Add audit logs for sensitive admin, billing, auth, permission, and data export actions.
|
|
23
|
+
- Document sensitive data flows, auth assumptions, and privacy-relevant behavior.
|
|
24
|
+
- Add threat-model notes for meaningful auth, billing, admin, AI/provider, and sensitive user-data workflows.
|
|
25
|
+
- Add rate limiting and abuse protection for public APIs, login/signup flows, expensive operations, and AI/vendor-backed calls.
|
|
26
|
+
- Maintain a security document with the auth model, permission model, threat model, abuse controls, dependency/security scanning, incident response, and known risks.
|
|
27
|
+
- Ask before adding analytics, tracking, paid services, or external data sharing.
|
|
28
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Generated by scripts/shard.ts — registry of rule packs in source order.
|
|
2
|
+
packs:
|
|
3
|
+
- name: core
|
|
4
|
+
category: base
|
|
5
|
+
path: base/core.md
|
|
6
|
+
condition: always
|
|
7
|
+
template: false
|
|
8
|
+
order: 1000
|
|
9
|
+
- name: git-safety
|
|
10
|
+
category: base
|
|
11
|
+
path: base/git-safety.md
|
|
12
|
+
condition: always
|
|
13
|
+
template: false
|
|
14
|
+
order: 2000
|
|
15
|
+
- name: stack
|
|
16
|
+
category: templated
|
|
17
|
+
path: templated/stack.md
|
|
18
|
+
condition: always
|
|
19
|
+
template: true
|
|
20
|
+
order: 3000
|
|
21
|
+
- name: project-docs
|
|
22
|
+
category: process
|
|
23
|
+
path: process/project-docs.md
|
|
24
|
+
condition: always
|
|
25
|
+
template: false
|
|
26
|
+
order: 4000
|
|
27
|
+
- name: tickets
|
|
28
|
+
category: process
|
|
29
|
+
path: process/tickets.md
|
|
30
|
+
condition: always
|
|
31
|
+
template: false
|
|
32
|
+
supersededByForeman: true
|
|
33
|
+
order: 5000
|
|
34
|
+
- name: tdd
|
|
35
|
+
category: process
|
|
36
|
+
path: process/tdd.md
|
|
37
|
+
condition: always
|
|
38
|
+
template: false
|
|
39
|
+
order: 6000
|
|
40
|
+
- name: testing
|
|
41
|
+
category: process
|
|
42
|
+
path: process/testing.md
|
|
43
|
+
condition: always
|
|
44
|
+
template: false
|
|
45
|
+
order: 7000
|
|
46
|
+
- name: ci
|
|
47
|
+
category: process
|
|
48
|
+
path: process/ci.md
|
|
49
|
+
condition: always
|
|
50
|
+
template: false
|
|
51
|
+
order: 8000
|
|
52
|
+
- name: dependencies
|
|
53
|
+
category: process
|
|
54
|
+
path: process/dependencies.md
|
|
55
|
+
condition: always
|
|
56
|
+
template: false
|
|
57
|
+
order: 9000
|
|
58
|
+
- name: code-quality
|
|
59
|
+
category: base
|
|
60
|
+
path: base/code-quality.md
|
|
61
|
+
condition: always
|
|
62
|
+
template: false
|
|
63
|
+
order: 10000
|
|
64
|
+
- name: api-docs
|
|
65
|
+
category: process
|
|
66
|
+
path: process/api-docs.md
|
|
67
|
+
condition: always
|
|
68
|
+
template: false
|
|
69
|
+
order: 11000
|
|
70
|
+
- name: scalability
|
|
71
|
+
category: domain
|
|
72
|
+
path: domain/scalability.md
|
|
73
|
+
condition: always
|
|
74
|
+
template: false
|
|
75
|
+
order: 12000
|
|
76
|
+
- name: infra
|
|
77
|
+
category: templated
|
|
78
|
+
path: templated/infra.md
|
|
79
|
+
condition: cloud
|
|
80
|
+
template: true
|
|
81
|
+
order: 13000
|
|
82
|
+
- name: database
|
|
83
|
+
category: templated
|
|
84
|
+
path: templated/database.md
|
|
85
|
+
condition: always
|
|
86
|
+
template: true
|
|
87
|
+
order: 14000
|
|
88
|
+
- name: data-governance
|
|
89
|
+
category: domain
|
|
90
|
+
path: domain/data-governance.md
|
|
91
|
+
condition: always
|
|
92
|
+
template: false
|
|
93
|
+
order: 15000
|
|
94
|
+
- name: security
|
|
95
|
+
category: domain
|
|
96
|
+
path: domain/security.md
|
|
97
|
+
condition: always
|
|
98
|
+
template: false
|
|
99
|
+
order: 16000
|
|
100
|
+
- name: ai-safety
|
|
101
|
+
category: domain
|
|
102
|
+
path: domain/ai-safety.md
|
|
103
|
+
condition: ai
|
|
104
|
+
template: false
|
|
105
|
+
order: 17000
|
|
106
|
+
- name: ai-governance
|
|
107
|
+
category: domain
|
|
108
|
+
path: domain/ai-governance.md
|
|
109
|
+
condition: ai
|
|
110
|
+
template: false
|
|
111
|
+
order: 18000
|
|
112
|
+
- name: robustness
|
|
113
|
+
category: domain
|
|
114
|
+
path: domain/robustness.md
|
|
115
|
+
condition: always
|
|
116
|
+
template: false
|
|
117
|
+
order: 19000
|
|
118
|
+
- name: ai-evals
|
|
119
|
+
category: domain
|
|
120
|
+
path: domain/ai-evals.md
|
|
121
|
+
condition: ai
|
|
122
|
+
template: false
|
|
123
|
+
order: 20000
|
|
124
|
+
- name: ai-reproducibility
|
|
125
|
+
category: domain
|
|
126
|
+
path: domain/ai-reproducibility.md
|
|
127
|
+
condition: ai
|
|
128
|
+
template: false
|
|
129
|
+
order: 21000
|
|
130
|
+
- name: ai-cost
|
|
131
|
+
category: domain
|
|
132
|
+
path: domain/ai-cost.md
|
|
133
|
+
condition: ai
|
|
134
|
+
template: false
|
|
135
|
+
order: 22000
|
|
136
|
+
- name: release
|
|
137
|
+
category: process
|
|
138
|
+
path: process/release.md
|
|
139
|
+
condition: always
|
|
140
|
+
template: false
|
|
141
|
+
order: 23000
|
|
142
|
+
- name: accessibility
|
|
143
|
+
category: domain
|
|
144
|
+
path: domain/accessibility.md
|
|
145
|
+
condition: frontend
|
|
146
|
+
template: false
|
|
147
|
+
order: 24000
|
|
148
|
+
- name: observability
|
|
149
|
+
category: domain
|
|
150
|
+
path: domain/observability.md
|
|
151
|
+
condition: always
|
|
152
|
+
template: false
|
|
153
|
+
order: 25000
|
|
154
|
+
- name: business-docs
|
|
155
|
+
category: process
|
|
156
|
+
path: process/business-docs.md
|
|
157
|
+
condition: always
|
|
158
|
+
template: false
|
|
159
|
+
order: 26000
|
|
160
|
+
- name: architecture
|
|
161
|
+
category: process
|
|
162
|
+
path: process/architecture.md
|
|
163
|
+
condition: always
|
|
164
|
+
template: false
|
|
165
|
+
order: 27000
|
|
166
|
+
- name: definition-of-done
|
|
167
|
+
category: base
|
|
168
|
+
path: base/definition-of-done.md
|
|
169
|
+
condition: always
|
|
170
|
+
template: false
|
|
171
|
+
order: 28000
|
|
172
|
+
- name: response-expectations
|
|
173
|
+
category: base
|
|
174
|
+
path: base/response-expectations.md
|
|
175
|
+
condition: always
|
|
176
|
+
template: false
|
|
177
|
+
order: 29000
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-docs
|
|
3
|
+
category: process
|
|
4
|
+
description: "Machine-readable API docs and contract tests."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## API And Contract Documentation
|
|
9
|
+
|
|
10
|
+
- Maintain machine-readable API docs for every public or internal API surface that other clients consume.
|
|
11
|
+
- Prefer OpenAPI/Swagger for HTTP APIs.
|
|
12
|
+
- Prefer JSDoc/Typedoc for TypeScript libraries and generated references where useful.
|
|
13
|
+
- Prefer docstrings plus generated references for Python APIs where useful.
|
|
14
|
+
- Update API docs, examples, request/response schemas, error shapes, auth requirements, and version notes when API behavior changes.
|
|
15
|
+
- Add or update contract tests for public API changes.
|
|
16
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture
|
|
3
|
+
category: process
|
|
4
|
+
description: "Architecture digest and ADR/decision-history discipline."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Architecture And Decisions
|
|
9
|
+
|
|
10
|
+
- Keep `docs/architecture.md` as a digest of how the app works now.
|
|
11
|
+
- Add ADRs in `docs/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 `docs/decisions/README.md` updated as the decision-making history index.
|
|
13
|
+
- ADRs should be short: context, decision, alternatives considered, consequences, date.
|
|
14
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: business-docs
|
|
3
|
+
category: process
|
|
4
|
+
description: "Keep business assumptions, costs, and risks current."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Business Documentation
|
|
9
|
+
|
|
10
|
+
- Keep `docs/business.md` current with product assumptions, cost drivers, vendor/service pricing notes, revenue/pricing ideas, operational risks, and open business questions.
|
|
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
|
+
- If exact pricing or costs require current external information, verify them before documenting.
|
|
13
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci
|
|
3
|
+
category: process
|
|
4
|
+
description: "Repeatable scripts and CI aligned with local verification."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Automation And CI
|
|
9
|
+
|
|
10
|
+
- Prefer repeatable project scripts over one-off commands.
|
|
11
|
+
- Keep CI aligned with the local verification commands agents are expected to run.
|
|
12
|
+
- Add or update CI checks when adding new test types, generated API docs, database migrations, security checks, or build steps.
|
|
13
|
+
- For AI features, add or update prompt/eval regression checks where practical.
|
|
14
|
+
- Include dependency vulnerability scanning and secret scanning in CI where practical.
|
|
15
|
+
- Include license checks, SBOM generation, and container image scanning for production applications where practical.
|
|
16
|
+
- Generated artifacts should be reproducible and documented with the command that updates them.
|
|
17
|
+
- Do not bypass failing CI without documenting the reason and the follow-up ticket.
|
|
18
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dependencies
|
|
3
|
+
category: process
|
|
4
|
+
description: "Dependency, license, SBOM, and vulnerability governance."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Dependency And Supply Chain Governance
|
|
9
|
+
|
|
10
|
+
- Do not add major dependencies, paid services, or vendor lock-in without a clear reason and user approval when the decision has meaningful cost, security, licensing, or maintenance impact.
|
|
11
|
+
- Prefer existing dependencies and standard library capabilities before adding new packages.
|
|
12
|
+
- Keep lockfiles committed and reproducible.
|
|
13
|
+
- Check dependency licenses before adding packages to production applications.
|
|
14
|
+
- Generate and maintain a software bill of materials for production applications where practical.
|
|
15
|
+
- Scan dependencies and container images for known vulnerabilities and address meaningful findings.
|
|
16
|
+
- Remove unused dependencies, stale packages, and abandoned integrations when discovered during relevant work.
|
|
17
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-docs
|
|
3
|
+
category: process
|
|
4
|
+
description: "The standard set of project documents to create and maintain."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Standard Project Documents
|
|
9
|
+
|
|
10
|
+
Create and maintain these documents unless the repository has equivalent files:
|
|
11
|
+
|
|
12
|
+
- `README.md`: developer install, setup, environment variables, run, test, build, and deploy basics.
|
|
13
|
+
- `docs/architecture.md`: architecture digest, major modules, data flow, integrations, infrastructure, and tradeoffs.
|
|
14
|
+
- `docs/features.md`: feature digest, user-facing capabilities, roles, permissions, and important workflows.
|
|
15
|
+
- `docs/api.md` or generated API docs: API overview and links to OpenAPI, Swagger, JSDoc, Typedoc, or equivalent generated references.
|
|
16
|
+
- `docs/users.md`: normal user documentation.
|
|
17
|
+
- `docs/admins.md`: admin/operator documentation.
|
|
18
|
+
- `docs/business.md`: business-level notes, feature rationale, pricing/costs, vendor costs, risk areas, operational concerns, and things to watch.
|
|
19
|
+
- `docs/operations.md`: deployment notes, monitoring, runbooks, incident response, backups, and recovery steps.
|
|
20
|
+
- `docs/security.md`: security model, threat model, auth, permissions, secrets, abuse controls, and incident response.
|
|
21
|
+
- `docs/data-governance.md`: data classification, PII handling, retention, deletion/export, consent, and training-data rules.
|
|
22
|
+
- `docs/local-cloud.md`: local runtime, cloud runtime, parity expectations, environment differences, and deployment notes.
|
|
23
|
+
- `docs/scalability.md`: scaling strategy for server, cloud, AI/model usage, frontend, databases, and overall architecture.
|
|
24
|
+
- `docs/ai.md`: AI workflows, model/provider choices, prompts, evals, safety controls, cost tracking, replayability, and training-data strategy when the app uses AI.
|
|
25
|
+
- `docs/ai-evals.md`: AI eval suites, golden examples, adversarial cases, quality gates, and prompt/model regression results.
|
|
26
|
+
- `docs/ai-costs.md`: AI cost tracking, cost per task, provider/model costs, high-cost workflows, and optimization notes.
|
|
27
|
+
- `docs/tickets.md`: ticket log, roadmap, backlog, status, acceptance criteria, and future ideas.
|
|
28
|
+
- `docs/decisions/`: ADRs and decision history for meaningful architecture, product, data, vendor, AI, or cost decisions.
|
|
29
|
+
- `docs/decisions/README.md`: decision-making history index with links to ADRs and a short status summary.
|
|
30
|
+
- `docs/release-checklist.md`: release readiness, versioning, migrations, rollback, smoke tests, and post-release checks.
|
|
31
|
+
- `CHANGELOG.md`: notable user-facing, API, migration, and operational changes.
|
|
32
|
+
- `.env.example`: documented environment variables with safe placeholder values.
|
|
33
|
+
|
|
34
|
+
When app behavior changes, update the affected docs in the same change.
|
|
35
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release
|
|
3
|
+
category: process
|
|
4
|
+
description: "Changelog, semver, release checklist, and post-release notes."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Release, Versioning, And Change Management
|
|
9
|
+
|
|
10
|
+
- Maintain `CHANGELOG.md` for notable user-facing, API, migration, security, AI/model, and operational changes.
|
|
11
|
+
- Use semantic versioning where it applies to published apps, APIs, packages, SDKs, or user-visible releases.
|
|
12
|
+
- Document breaking changes, deprecations, migration steps, rollback steps, and user/admin impact.
|
|
13
|
+
- Use `docs/release-checklist.md` before releases that affect users, production data, public APIs, infrastructure, billing, auth, or AI behavior.
|
|
14
|
+
- Include smoke tests, monitoring checks, migration checks, environment-variable checks, documentation updates, and rollback readiness in release planning.
|
|
15
|
+
- After release, document incidents, regressions, follow-up work, and any release-process improvements.
|
|
16
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
category: process
|
|
4
|
+
description: "Test-driven development discipline: identify behavior, write tests first, then minimal code."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Test-Driven Development
|
|
9
|
+
|
|
10
|
+
- Always use test-driven development for application code changes wherever practical.
|
|
11
|
+
- Start by identifying the expected behavior and acceptance criteria.
|
|
12
|
+
- For new behavior or bug fixes, write or update tests first when practical, then implement the minimal code needed to pass, then refactor.
|
|
13
|
+
- Cover business logic, API contracts, permissions, data access, validation, error handling, and critical UI workflows.
|
|
14
|
+
- For UI work, include component tests, integration tests, or end-to-end tests where they provide meaningful confidence.
|
|
15
|
+
- If TDD is not practical for a specific change, explain why briefly and still add the best reasonable coverage.
|
|
16
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: testing
|
|
3
|
+
category: process
|
|
4
|
+
description: "Discover and run the repo's quality commands; verification order."
|
|
5
|
+
condition: always
|
|
6
|
+
template: false
|
|
7
|
+
---
|
|
8
|
+
## Testing And Verification
|
|
9
|
+
|
|
10
|
+
- Always discover and use the repository's existing test, lint, typecheck, build, migration, and formatting commands.
|
|
11
|
+
- If standard quality commands do not exist yet, add or propose them before the project grows around inconsistent tooling.
|
|
12
|
+
- Run relevant tests during development, then run the full practical verification suite before considering work complete.
|
|
13
|
+
- If tests fail, fix the code so they pass unless the test expectations are clearly obsolete.
|
|
14
|
+
- If test requirements may have changed and the correct behavior is unclear, ask the user before rewriting the tests.
|
|
15
|
+
- When tests are updated, explain what changed and why in simple, concise language.
|
|
16
|
+
- Do not claim tests passed unless they were actually run and passed.
|
|
17
|
+
- If a command cannot be run, report the command, the reason, and the remaining risk.
|
|
18
|
+
|
|
19
|
+
Preferred verification order when available:
|
|
20
|
+
|
|
21
|
+
1. Targeted tests for the changed behavior.
|
|
22
|
+
2. Typecheck/static analysis.
|
|
23
|
+
3. Lint/format checks.
|
|
24
|
+
4. Full test suite.
|
|
25
|
+
5. Build.
|
|
26
|
+
6. Database migration validation.
|
|
27
|
+
7. End-to-end or smoke tests for user-facing changes.
|
|
28
|
+
|