threadroot 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.
Files changed (39) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +261 -0
  4. package/SECURITY.md +22 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +4341 -0
  7. package/package.json +81 -0
  8. package/packs/code-review/pack.yaml +7 -0
  9. package/packs/python/pack.yaml +10 -0
  10. package/packs/react-app/pack.yaml +10 -0
  11. package/packs/security-review/pack.yaml +7 -0
  12. package/packs/system-design/pack.yaml +5 -0
  13. package/packs/testing/pack.yaml +7 -0
  14. package/packs/typescript-node/pack.yaml +9 -0
  15. package/skills/README.md +39 -0
  16. package/skills/add-test/SKILL.md +20 -0
  17. package/skills/add-test/evals/triggers.json +12 -0
  18. package/skills/build-skill/SKILL.md +36 -0
  19. package/skills/build-skill/evals/triggers.json +16 -0
  20. package/skills/build-skill/references/eval-prompts.md +20 -0
  21. package/skills/build-skill/references/skill-quality.md +18 -0
  22. package/skills/build-tool/SKILL.md +35 -0
  23. package/skills/build-tool/evals/triggers.json +13 -0
  24. package/skills/catalog.json +50 -0
  25. package/skills/code-review/SKILL.md +24 -0
  26. package/skills/code-review/evals/triggers.json +12 -0
  27. package/skills/conventional-commits/SKILL.md +29 -0
  28. package/skills/conventional-commits/evals/triggers.json +12 -0
  29. package/skills/debug-failure/SKILL.md +21 -0
  30. package/skills/debug-failure/evals/triggers.json +12 -0
  31. package/skills/security-review/SKILL.md +24 -0
  32. package/skills/security-review/evals/triggers.json +12 -0
  33. package/skills/system-design/SKILL.md +33 -0
  34. package/skills/system-design/evals/triggers.json +17 -0
  35. package/skills/system-design/references/api-data-design.md +15 -0
  36. package/skills/system-design/references/architecture-checklist.md +26 -0
  37. package/skills/system-design/references/reliability-observability.md +17 -0
  38. package/skills/write-docs/SKILL.md +20 -0
  39. package/skills/write-docs/evals/triggers.json +12 -0
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "threadroot",
3
+ "version": "0.1.0",
4
+ "description": "Git for your AI agent harness: author skills, rules, tools, and memory once and compile them to every vendor format.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "bin": {
16
+ "threadroot": "dist/index.js",
17
+ "tr": "dist/index.js"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/Sevan1211/threadroot.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/Sevan1211/threadroot/issues"
25
+ },
26
+ "homepage": "https://github.com/Sevan1211/threadroot#readme",
27
+ "keywords": [
28
+ "ai",
29
+ "agents",
30
+ "agentic",
31
+ "codex",
32
+ "claude",
33
+ "cursor",
34
+ "copilot",
35
+ "mcp",
36
+ "developer-tools",
37
+ "cli",
38
+ "skills"
39
+ ],
40
+ "files": [
41
+ "dist",
42
+ "skills",
43
+ "packs",
44
+ "CHANGELOG.md",
45
+ "SECURITY.md"
46
+ ],
47
+ "scripts": {
48
+ "build": "tsup src/index.ts --format esm --dts --clean",
49
+ "dev": "tsx src/index.ts",
50
+ "prepack": "pnpm build",
51
+ "prepublishOnly": "pnpm typecheck && pnpm lint && pnpm test",
52
+ "pack:check": "npm --cache /tmp/threadroot-npm-cache pack --dry-run",
53
+ "package:smoke": "node scripts/package-smoke.mjs",
54
+ "release:check": "pnpm typecheck && pnpm lint && pnpm test && pnpm pack:check && pnpm package:smoke",
55
+ "test": "vitest run",
56
+ "typecheck": "tsc --noEmit",
57
+ "lint": "eslint ."
58
+ },
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "dependencies": {
63
+ "commander": "^12.1.0",
64
+ "yaml": "^2.9.0",
65
+ "zod": "^3.24.1"
66
+ },
67
+ "devDependencies": {
68
+ "@eslint/js": "^9",
69
+ "@types/node": "^22.10.2",
70
+ "eslint": "^9",
71
+ "tsup": "^8.3.5",
72
+ "tsx": "^4.19.2",
73
+ "typescript": "^5.7.2",
74
+ "typescript-eslint": "^8",
75
+ "vitest": "^2.1.8"
76
+ },
77
+ "engines": {
78
+ "node": ">=20"
79
+ },
80
+ "packageManager": "pnpm@9.12.0"
81
+ }
@@ -0,0 +1,7 @@
1
+ name: code-review
2
+ version: 1
3
+ description: Code review and commit hygiene skills for agent-assisted development.
4
+ skills:
5
+ - skills/code-review
6
+ - skills/security-review
7
+ - skills/conventional-commits
@@ -0,0 +1,10 @@
1
+ name: python
2
+ version: 1
3
+ description: Python project skills for tests, debugging, review, docs, and tool authoring.
4
+ skills:
5
+ - skills/add-test
6
+ - skills/debug-failure
7
+ - skills/code-review
8
+ - skills/security-review
9
+ - skills/write-docs
10
+ - skills/build-tool
@@ -0,0 +1,10 @@
1
+ name: react-app
2
+ version: 1
3
+ description: React application skills for testing, review, docs, and safe tool authoring.
4
+ skills:
5
+ - skills/add-test
6
+ - skills/debug-failure
7
+ - skills/code-review
8
+ - skills/security-review
9
+ - skills/write-docs
10
+ - skills/build-tool
@@ -0,0 +1,7 @@
1
+ name: security-review
2
+ version: 1
3
+ description: Security review skills for identifying risky code, tools, and project changes.
4
+ skills:
5
+ - skills/security-review
6
+ - skills/code-review
7
+ - skills/build-tool
@@ -0,0 +1,5 @@
1
+ name: system-design
2
+ version: 1
3
+ description: System design skills for architecture, APIs, data, reliability, and observability.
4
+ skills:
5
+ - skills/system-design
@@ -0,0 +1,7 @@
1
+ name: testing
2
+ version: 1
3
+ description: Testing-focused skills for adding, fixing, and reviewing project tests.
4
+ skills:
5
+ - skills/add-test
6
+ - skills/debug-failure
7
+ - skills/code-review
@@ -0,0 +1,9 @@
1
+ name: typescript-node
2
+ version: 1
3
+ description: Core TypeScript and Node.js agent harness skills for CLI and library projects.
4
+ skills:
5
+ - skills/add-test
6
+ - skills/debug-failure
7
+ - skills/code-review
8
+ - skills/build-tool
9
+ - skills/conventional-commits
@@ -0,0 +1,39 @@
1
+ # Threadroot Skills
2
+
3
+ Curated Agent Skills that can be installed into any Threadroot harness.
4
+
5
+ ```bash
6
+ threadroot install github:Sevan1211/threadroot/skills/system-design@main --kind skill
7
+ threadroot install github:Sevan1211/threadroot/skills/build-skill@main --kind skill
8
+ threadroot skills validate --path skills
9
+ threadroot skills inspect skills/system-design
10
+ ```
11
+
12
+ Each skill uses the folder shape:
13
+
14
+ ```text
15
+ skills/<name>/
16
+ SKILL.md
17
+ references/
18
+ scripts/
19
+ assets/
20
+ evals/triggers.json
21
+ ```
22
+
23
+ Keep `SKILL.md` compact and procedural. Put detailed checklists, examples, and
24
+ variant-specific guidance in `references/`, then link those files from `SKILL.md` so
25
+ agents can load only the relevant details for the task.
26
+
27
+ Good skills should:
28
+
29
+ - Use a precise `description` that tells the agent when to trigger the skill.
30
+ - Keep always-loaded instructions short enough to fit comfortably in context.
31
+ - Move deep guidance, examples, and checklists into linked reference files.
32
+ - Include `evals/triggers.json` with positive and negative trigger examples.
33
+ - Avoid scripts and allowed tools unless the workflow truly needs them.
34
+
35
+ Validate the curated pack before release:
36
+
37
+ ```bash
38
+ threadroot skills validate --path skills
39
+ ```
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: add-test
3
+ description: Use when adding, fixing, or reviewing tests for code changes, bugs, edge cases, regressions, CLI behavior, MCP tools, schemas, adapters, or generated output.
4
+ scope: project
5
+ tags:
6
+ - testing
7
+ ---
8
+
9
+ # Add Test
10
+
11
+ Write tests that pin observable behavior, not implementation trivia.
12
+
13
+ ## Workflow
14
+
15
+ 1. Identify the behavior, boundary, or bug being protected.
16
+ 2. Find the nearest existing test style and reuse local helpers.
17
+ 3. Cover the happy path and at least one meaningful failure or edge case.
18
+ 4. Keep tests deterministic and independent.
19
+ 5. If fixing a bug, confirm the test fails before the fix when practical.
20
+ 6. Run the narrow test first, then the broader gate.
@@ -0,0 +1,12 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Add regression tests for this bug fix.",
4
+ "Write tests that cover this CLI command's failure modes.",
5
+ "Update the test suite for this schema validation change."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Review this PR for security issues.",
9
+ "Plan the architecture for a new service.",
10
+ "Write a README quickstart."
11
+ ]
12
+ }
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: build-skill
3
+ description: Use when creating, reviewing, or improving Threadroot or Agent Skills, including SKILL.md descriptions, progressive disclosure, bundled references/scripts/assets, validation, trigger quality, and skill evals.
4
+ scope: project
5
+ tags:
6
+ - skills
7
+ - agent-harness
8
+ - prompting
9
+ ---
10
+
11
+ # Build Skill
12
+
13
+ Build skills as compact operating procedures, not essays. Assume the model is capable; add only context that improves repeatability, accuracy, or safety.
14
+
15
+ ## Workflow
16
+
17
+ 1. Capture concrete trigger examples and non-trigger examples.
18
+ 2. Write a precise `description` that says what the skill does and when to use it. The description is the trigger surface.
19
+ 3. Keep `SKILL.md` procedural and short. Move variant details, schemas, examples, policies, and longer guidance into `references/`.
20
+ 4. Add scripts only for deterministic, fragile, or frequently repeated work. Scripts must be non-interactive and have clear errors.
21
+ 5. Add assets only when the skill needs reusable output material such as templates or boilerplate.
22
+ 6. Add eval prompts that compare with-skill and without-skill behavior on realistic tasks.
23
+ 7. Validate frontmatter, folder naming, reference links, and token footprint before shipping.
24
+
25
+ ## Quality Bar
26
+
27
+ - Prefer one strong skill per repeatable workflow over giant catch-all skills.
28
+ - Keep instructions imperative and directly actionable.
29
+ - Include failure modes and validation steps.
30
+ - Do not duplicate reference content in `SKILL.md`; link to it.
31
+ - Never hide risky tool use in a skill. Surface confirmation, trust, and environment needs clearly.
32
+
33
+ ## Reference Loading
34
+
35
+ - Read `references/skill-quality.md` before authoring a new curated skill.
36
+ - Read `references/eval-prompts.md` when adding or reviewing skill tests.
@@ -0,0 +1,16 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Create a skill for reviewing Prisma schema migrations.",
4
+ "Improve this SKILL.md so it triggers more accurately and uses references correctly.",
5
+ "Help me design eval prompts for a frontend performance skill."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Use the existing testing skill to add coverage for this function.",
9
+ "Install a package from npm.",
10
+ "Summarize this product requirement document."
11
+ ],
12
+ "expectedReferences": [
13
+ "references/skill-quality.md",
14
+ "references/eval-prompts.md"
15
+ ]
16
+ }
@@ -0,0 +1,20 @@
1
+ # Skill Eval Prompts
2
+
3
+ Use these prompt patterns to validate a skill.
4
+
5
+ ## Should Trigger
6
+
7
+ - Ask for the exact workflow the skill claims to improve.
8
+ - Include ambiguous real-world constraints.
9
+ - Check whether the agent loads only relevant references.
10
+
11
+ ## Should Not Trigger
12
+
13
+ - Ask for adjacent tasks that share vocabulary but not intent.
14
+ - Check that the skill description is not too broad.
15
+
16
+ ## Output Checks
17
+
18
+ - Did the answer follow the skill workflow?
19
+ - Did it avoid irrelevant reference loading?
20
+ - Did it produce safer, more specific, or more complete output than a no-skill baseline?
@@ -0,0 +1,18 @@
1
+ # Skill Quality
2
+
3
+ A strong skill has:
4
+
5
+ - Clear trigger description with realistic language users and agents will use.
6
+ - A narrow job and explicit boundaries.
7
+ - A short procedural body that changes behavior after loading.
8
+ - References for deep details, split by task variant.
9
+ - Scripts for deterministic repeated work.
10
+ - Evals that prove it improves outcomes.
11
+
12
+ Avoid:
13
+
14
+ - Generic best-practice lists with no workflow.
15
+ - Repeating common model knowledge.
16
+ - Large always-loaded manuals.
17
+ - Broad descriptions that trigger on unrelated work.
18
+ - Skills that silently require credentials, network access, or destructive commands.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: build-tool
3
+ description: Use when creating, reviewing, or improving Threadroot tools, especially executable commands, local CLI wrappers, healthchecks, risk levels, confirmation behavior, inputs, and connection-backed capabilities.
4
+ scope: project
5
+ tags:
6
+ - tools
7
+ - security
8
+ - agent-harness
9
+ ---
10
+
11
+ # Build Tool
12
+
13
+ Create tools as small, explicit, testable wrappers around commands the project already trusts.
14
+
15
+ ## Workflow
16
+
17
+ 1. Identify the exact command the user or repo already uses.
18
+ 2. Prefer a read-only or validation command first.
19
+ 3. Classify risk:
20
+ - `low`: reads state, validates, tests, formats, or prints information.
21
+ - `medium`: writes local files or changes non-production state.
22
+ - `high`: deploys, deletes, migrates, publishes, spends money, changes cloud resources, or touches secrets.
23
+ 4. Require `confirm: true` for high-risk tools.
24
+ 5. If the command depends on a cloud/account CLI, reference a `.threadroot/connections/*.yaml` connection.
25
+ 6. Declare inputs instead of accepting freeform shell fragments.
26
+ 7. Add a finite `healthcheck` when possible. Do not use long-running dev servers as healthchecks.
27
+ 8. Validate with `threadroot tools check` and `threadroot doctor`.
28
+
29
+ ## Safety Rules
30
+
31
+ - Never put secrets, tokens, passwords, or private keys in tool manifests.
32
+ - Never hide destructive behavior behind a low-risk description.
33
+ - Keep shell commands narrow; prefer existing package scripts, Make targets, just recipes, or official CLIs.
34
+ - Use connection manifests for AWS, GitHub, Azure, Snowflake, and similar authenticated CLIs.
35
+ - If unsure, mark the tool high risk and require confirmation.
@@ -0,0 +1,13 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Create a Threadroot tool for running tests",
4
+ "Wrap an AWS CLI command as a safe agent tool",
5
+ "Add a healthcheck to this harness tool",
6
+ "Review this tool manifest for risk and confirmation behavior"
7
+ ],
8
+ "shouldNotTrigger": [
9
+ "Design the data model for this app",
10
+ "Write release notes for this change",
11
+ "Debug this failing unit test"
12
+ ]
13
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "version": 1,
3
+ "skills": [
4
+ {
5
+ "name": "system-design",
6
+ "description": "Architecture and tradeoff design for new or existing software systems.",
7
+ "path": "skills/system-design"
8
+ },
9
+ {
10
+ "name": "build-skill",
11
+ "description": "Create and improve high-quality Threadroot and Agent Skills.",
12
+ "path": "skills/build-skill"
13
+ },
14
+ {
15
+ "name": "build-tool",
16
+ "description": "Create and improve safe, testable Threadroot tools and connection-backed capabilities.",
17
+ "path": "skills/build-tool"
18
+ },
19
+ {
20
+ "name": "code-review",
21
+ "description": "Review code, pull requests, generated changes, and agent output.",
22
+ "path": "skills/code-review"
23
+ },
24
+ {
25
+ "name": "security-review",
26
+ "description": "Review trust boundaries, tool execution, supply-chain risk, and unsafe inputs.",
27
+ "path": "skills/security-review"
28
+ },
29
+ {
30
+ "name": "add-test",
31
+ "description": "Add or improve tests around changed behavior and regressions.",
32
+ "path": "skills/add-test"
33
+ },
34
+ {
35
+ "name": "debug-failure",
36
+ "description": "Debug failing tests, broken builds, runtime errors, and bad generated output.",
37
+ "path": "skills/debug-failure"
38
+ },
39
+ {
40
+ "name": "write-docs",
41
+ "description": "Write or update technical documentation and agent-facing instructions.",
42
+ "path": "skills/write-docs"
43
+ },
44
+ {
45
+ "name": "conventional-commits",
46
+ "description": "Write structured git commit messages and release summaries.",
47
+ "path": "skills/conventional-commits"
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: code-review
3
+ description: Use when reviewing code, pull requests, diffs, generated changes, or agent output for correctness, regressions, risk, maintainability, security, and missing tests.
4
+ scope: project
5
+ tags:
6
+ - review
7
+ - quality
8
+ ---
9
+
10
+ # Code Review
11
+
12
+ Review behavior before style.
13
+
14
+ ## Workflow
15
+
16
+ 1. Identify the claimed intent of the change.
17
+ 2. Inspect the behavioral path, data flow, edge cases, and failure handling.
18
+ 3. Check for security issues: input validation, auth boundaries, path traversal, command execution, secrets, unsafe defaults.
19
+ 4. Check tests: missing coverage, weak assertions, untested failures, snapshots that hide behavior.
20
+ 5. Report findings first, ordered by severity, with file/line references when available.
21
+
22
+ ## Output
23
+
24
+ Lead with findings. If there are no material issues, say so and mention residual risk or test gaps.
@@ -0,0 +1,12 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Review this diff for correctness and missing tests.",
4
+ "Can you check this PR for regressions and risky edge cases?",
5
+ "Look at these generated changes and tell me if anything should block merge."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Design a new database schema from scratch.",
9
+ "Write docs for this CLI command.",
10
+ "Debug this failing test output."
11
+ ]
12
+ }
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: conventional-commits
3
+ description: Use when writing, reviewing, or suggesting git commit messages, release notes, changelog entries, or structured commit summaries.
4
+ scope: project
5
+ tags:
6
+ - git
7
+ - commits
8
+ ---
9
+
10
+ # Conventional Commits
11
+
12
+ Write commits as `type(scope): subject`.
13
+
14
+ ## Types
15
+
16
+ - `feat`: user-visible feature.
17
+ - `fix`: bug fix.
18
+ - `docs`: documentation only.
19
+ - `refactor`: behavior-preserving code change.
20
+ - `test`: test-only change.
21
+ - `chore`: maintenance.
22
+ - `build` or `ci`: build system or CI.
23
+
24
+ ## Rules
25
+
26
+ - Keep the subject imperative, specific, and under about 72 characters.
27
+ - Do not add a trailing period.
28
+ - Explain why in the body when the change is non-obvious.
29
+ - Mark breaking changes with `!` or a `BREAKING CHANGE:` footer.
@@ -0,0 +1,12 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Write a commit message for these changes.",
4
+ "Suggest a Conventional Commit subject for this diff.",
5
+ "Turn this summary into a release-note style commit body."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Review this code for correctness.",
9
+ "Add tests for this parser.",
10
+ "Design the database schema."
11
+ ]
12
+ }
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: debug-failure
3
+ description: Use when debugging failing tests, broken builds, runtime errors, flaky behavior, bad generated output, or unexpected CLI/MCP behavior.
4
+ scope: project
5
+ tags:
6
+ - debugging
7
+ ---
8
+
9
+ # Debug Failure
10
+
11
+ Reproduce, isolate, fix the cause, then preserve the lesson.
12
+
13
+ ## Workflow
14
+
15
+ 1. Capture the exact command, output, environment, and recent change.
16
+ 2. Reproduce the failure with the smallest command.
17
+ 3. Read the full error before editing.
18
+ 4. Form one hypothesis at a time and test it.
19
+ 5. Add or update a regression test when the failure reveals a bug.
20
+ 6. After fixing, run the narrow test and relevant full gate.
21
+ 7. Record durable lessons in pitfalls memory when useful.
@@ -0,0 +1,12 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "This test is failing; help me reproduce and isolate the cause.",
4
+ "The build broke after my last change, debug it.",
5
+ "The CLI output is unexpected; figure out what changed."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Design a new API contract.",
9
+ "Add a new skill for code review.",
10
+ "Write a changelog entry."
11
+ ]
12
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: security-review
3
+ description: Use when evaluating code, tools, scripts, install flows, MCP surfaces, auth, filesystem access, command execution, secrets, supply-chain risk, or user-controlled input for security issues.
4
+ scope: project
5
+ tags:
6
+ - security
7
+ - review
8
+ ---
9
+
10
+ # Security Review
11
+
12
+ Focus on exploitable paths and trust boundaries.
13
+
14
+ ## Workflow
15
+
16
+ 1. Identify attacker-controlled inputs and privileged outputs.
17
+ 2. Trace filesystem, network, shell, database, credential, and MCP/tool execution paths.
18
+ 3. Look for path traversal, command injection, unsafe deserialization, auth bypass, secret exposure, SSRF, dependency risk, and confused-deputy behavior.
19
+ 4. Verify allow-lists, confirmation prompts, provenance, integrity checks, and least privilege.
20
+ 5. Recommend the smallest fix that closes the class of bug, plus a regression test.
21
+
22
+ ## Output
23
+
24
+ Use severity labels. Distinguish confirmed vulnerabilities from hardening suggestions.
@@ -0,0 +1,12 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Review this install flow for path traversal and command execution risks.",
4
+ "Check whether this MCP tool exposes unsafe file or shell access.",
5
+ "Audit this authentication middleware for bypasses and unsafe defaults."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Write a release note for this change.",
9
+ "Suggest a commit message.",
10
+ "Explain what this component renders."
11
+ ]
12
+ }
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: system-design
3
+ description: Use when designing, reviewing, or changing software architecture, APIs, data models, scaling strategy, reliability, observability, security, deployment, or technical tradeoffs for a new or existing system.
4
+ scope: project
5
+ tags:
6
+ - architecture
7
+ - system-design
8
+ - planning
9
+ ---
10
+
11
+ # System Design
12
+
13
+ Use this skill before major implementation when architecture decisions could be expensive to reverse.
14
+
15
+ ## Workflow
16
+
17
+ 1. Clarify the product goal, users, constraints, traffic, data sensitivity, integration points, and deployment target.
18
+ 2. Separate hard requirements, soft preferences, non-goals, and unknowns.
19
+ 3. Propose the simplest architecture that satisfies the known constraints before adding scale patterns.
20
+ 4. Define API boundaries, data ownership, background jobs, and external dependencies.
21
+ 5. Identify failure modes, abuse cases, operational risks, rollback strategy, and observability.
22
+ 6. Compare tradeoffs explicitly: reliability, security, performance, cost, operability, and delivery speed.
23
+ 7. Produce a concrete implementation plan and validation plan.
24
+
25
+ ## Output Shape
26
+
27
+ Return concise sections: Goal, Requirements, Non-goals, Constraints, Proposed Architecture, Data Model, API Surface, Background Jobs, Failure Modes, Security, Observability, Cost/Scale Assumptions, Tradeoffs, Implementation Plan, Validation Plan.
28
+
29
+ ## Reference Loading
30
+
31
+ - Read `references/architecture-checklist.md` for architecture review prompts.
32
+ - Read `references/reliability-observability.md` when uptime, incidents, metrics, queues, or distributed behavior matter.
33
+ - Read `references/api-data-design.md` when designing public APIs, schemas, migrations, or integration boundaries.
@@ -0,0 +1,17 @@
1
+ {
2
+ "shouldTrigger": [
3
+ "Design the architecture for a multi-tenant analytics dashboard with background imports and usage limits.",
4
+ "Before we build billing, help me decide the API boundaries, data model, failure modes, and rollout plan.",
5
+ "Review this proposed queue-based architecture for reliability, observability, and operational risks."
6
+ ],
7
+ "shouldNotTrigger": [
8
+ "Write a unit test for this pure date formatting helper.",
9
+ "Fix this typo in the README.",
10
+ "Create a conventional commit message for my current diff."
11
+ ],
12
+ "expectedReferences": [
13
+ "references/architecture-checklist.md",
14
+ "references/reliability-observability.md",
15
+ "references/api-data-design.md"
16
+ ]
17
+ }
@@ -0,0 +1,15 @@
1
+ # API And Data Design
2
+
3
+ Use this reference when defining interfaces, schemas, persistence, or migrations.
4
+
5
+ ## API Shape
6
+
7
+ - Define request/response types, auth, validation, pagination, idempotency, and error format.
8
+ - Keep external APIs stable and version only when compatibility requires it.
9
+ - Prefer explicit domain names over transport/framework names.
10
+
11
+ ## Data Shape
12
+
13
+ - Identify source-of-truth tables/entities and derived/cache data.
14
+ - Name uniqueness constraints, indexes, retention, deletion, and privacy requirements.
15
+ - Plan migrations as reversible or forward-fixable steps.