@botdigit/agent-blueprint 1.0.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 (52) hide show
  1. package/AGENTS.md +204 -0
  2. package/LICENSE +21 -0
  3. package/PROMPT.md +22 -0
  4. package/README.md +248 -0
  5. package/bin/cli.js +160 -0
  6. package/frameworks/axum/SKILL.md +73 -0
  7. package/frameworks/django/SKILL.md +71 -0
  8. package/frameworks/fastapi/SKILL.md +73 -0
  9. package/frameworks/laravel/SKILL.md +67 -0
  10. package/frameworks/nextjs/SKILL.md +60 -0
  11. package/frameworks/rails/SKILL.md +78 -0
  12. package/frameworks/react/SKILL.md +58 -0
  13. package/frameworks/spring/SKILL.md +79 -0
  14. package/install.sh +83 -0
  15. package/llms.txt +26 -0
  16. package/package.json +47 -0
  17. package/skills/00-orchestrator/.gitkeep +26 -0
  18. package/skills/00-orchestrator/SKILL.md +368 -0
  19. package/skills/00-orchestrator/decision-tree.md +93 -0
  20. package/skills/00-orchestrator/project-detection.md +81 -0
  21. package/skills/00-orchestrator/skill-selection.md +87 -0
  22. package/skills/00-orchestrator/workflow.md +25 -0
  23. package/skills/01-discovery/SKILL.md +66 -0
  24. package/skills/02-project-context/SKILL.md +89 -0
  25. package/skills/03-business-architecture/SKILL.md +231 -0
  26. package/skills/04-architecture/SKILL.md +131 -0
  27. package/skills/05-documentation/SKILL.md +133 -0
  28. package/skills/06-codebase-audit/SKILL.md +127 -0
  29. package/skills/07-security/SKILL.md +159 -0
  30. package/skills/08-testing/SKILL.md +120 -0
  31. package/skills/09-performance/SKILL.md +96 -0
  32. package/skills/10-audit/SKILL.md +112 -0
  33. package/stacks/dotnet/SKILL.md +56 -0
  34. package/stacks/go/SKILL.md +61 -0
  35. package/stacks/java/SKILL.md +58 -0
  36. package/stacks/javascript/SKILL.md +47 -0
  37. package/stacks/php/SKILL.md +51 -0
  38. package/stacks/python/SKILL.md +52 -0
  39. package/stacks/ruby/SKILL.md +51 -0
  40. package/stacks/rust/SKILL.md +55 -0
  41. package/stacks/typescript/SKILL.md +55 -0
  42. package/templates/adr/ADR-TEMPLATE.md +64 -0
  43. package/templates/api-spec/API_SPEC_TEMPLATE.md +137 -0
  44. package/templates/architecture/ARCHITECTURE_TEMPLATE.md +81 -0
  45. package/templates/business-requirements/BUSINESS_REQUIREMENTS_TEMPLATE.md +77 -0
  46. package/templates/changelog/CHANGELOG_TEMPLATE.md +37 -0
  47. package/templates/database/DATABASE_TEMPLATE.md +77 -0
  48. package/templates/deployment/DEPLOYMENT_TEMPLATE.md +80 -0
  49. package/templates/project-brief/PROJECT_BRIEF_TEMPLATE.md +72 -0
  50. package/templates/runbook/RUNBOOK_TEMPLATE.md +54 -0
  51. package/templates/security/SECURITY_TEMPLATE.md +93 -0
  52. package/templates/testing/TESTING_TEMPLATE.md +87 -0
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@botdigit/agent-blueprint",
3
+ "version": "1.0.0",
4
+ "description": "The universal blueprint and skill standard for AI coding agents — teaching agents how to think, audit, architect, and properly document any software project.",
5
+ "main": "bin/cli.js",
6
+ "bin": "./bin/cli.js",
7
+ "files": [
8
+ "bin",
9
+ "skills",
10
+ "stacks",
11
+ "frameworks",
12
+ "templates",
13
+ "AGENTS.md",
14
+ "README.md",
15
+ "LICENSE",
16
+ "install.sh",
17
+ "llms.txt",
18
+ "PROMPT.md"
19
+ ],
20
+ "scripts": {
21
+ "test": "node bin/cli.js status"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/botdigit-official/agent-blueprint.git"
26
+ },
27
+ "keywords": [
28
+ "ai-agents",
29
+ "coding-agents",
30
+ "agentic-workflows",
31
+ "cursor",
32
+ "claude-code",
33
+ "antigravity",
34
+ "windsurf",
35
+ "developer-tools",
36
+ "prompt-engineering",
37
+ "software-architecture",
38
+ "code-audit",
39
+ "documentation"
40
+ ],
41
+ "author": "BotDigit (https://botdigit.com)",
42
+ "license": "MIT",
43
+ "bugs": {
44
+ "url": "https://github.com/botdigit-official/agent-blueprint/issues"
45
+ },
46
+ "homepage": "https://github.com/botdigit-official/agent-blueprint#readme"
47
+ }
@@ -0,0 +1,26 @@
1
+ cd ./ProjectSkillsOS && git init && git add -A && git commit -m "$(cat <<'COMMIT_EOF'
2
+ Initialize Project Skills OS v1.0
3
+
4
+ Core philosophy, architecture, and 10 foundational skills:
5
+ - 00-orchestrator (triage, detect, select)
6
+ - 01-discovery (locate project)
7
+ - 02-project-context (detect stack)
8
+ - 03-business-architecture (domain, actors, rules, flows)
9
+ - 04-architecture (review, ADR, gaps)
10
+ - 05-documentation (living docs standard)
11
+ - 06-codebase-audit (code inspection)
12
+ - 07-security (security review)
13
+ - 08-testing (test strategy)
14
+ - 09-performance (performance review)
15
+ - 10-audit (combined audit workflow)
16
+
17
+ Stack adapters: javascript, typescript, python, php, rust, go, java, ruby, dotnet
18
+ Framework adapters: nextjs, react, laravel, django, fastapi, axum, rails, spring
19
+ Templates: ADR, project-brief, business-requirements, architecture, database, security, testing, deployment, runbook, changelog
20
+ Examples: botdigit-site, saas, marketplace, ecommerce, fintech, directory, mobile-app, ai-product, internal-tool
21
+
22
+ The agent must adapt to the project. The project must not be forced to adapt to the skill.
23
+
24
+ Co-Authored-By: Codebuff <noreply@codebuff.com>
25
+ COMMIT_EOF
26
+ )"
@@ -0,0 +1,368 @@
1
+ # 00-Orchestrator Skill
2
+
3
+ **Version:** 1.0.0
4
+ **Compatible:** project_skills >= 1.0
5
+ **Requires:** discovery
6
+ **Outputs:** selected-skills.md, project-classification.md
7
+
8
+ ---
9
+
10
+ ## Purpose
11
+
12
+ The orchestrator is the entry point and decision engine for all agent work on a project. It:
13
+
14
+ 1. Classifies the project state (greenfield / healthy / partial / broken)
15
+ 2. Detects the technology stack automatically
16
+ 3. Detects the project type and business domain
17
+ 4. Selects the minimum applicable skill set
18
+ 5. Establishes the workflow for the current task
19
+
20
+ Every agent session starts here.
21
+
22
+ ---
23
+
24
+ ## Core Principle
25
+
26
+ **Do not select skills by assumption. Select skills by detection.**
27
+
28
+ Never say "this is a Laravel project, use the Laravel skill." Instead:
29
+
30
+ 1. Inspect `composer.json`, `artisan`, `app/`, `config/` — confirm it is Laravel
31
+ 2. Confirm the Laravel version
32
+ 3. Activate the Laravel adapter
33
+ 4. Also activate any other detected technologies
34
+
35
+ ---
36
+
37
+ ## Workflow
38
+
39
+ ### Phase 1: Project State Classification
40
+
41
+ ```
42
+ ┌─────────────────────────┐
43
+ │ Is there existing │
44
+ │ code in the project? │
45
+ └────────────┬────────────┘
46
+
47
+ ┌──────────────┼──────────────┐
48
+ │ YES │ NO
49
+ ▼ ▼
50
+ ┌───────────────────┐ ┌───────────────────┐
51
+ │ Is the code │ │ Greenfield │
52
+ │ healthy, partial, │ │ Workflow │
53
+ │ or broken? │ │ │
54
+ └────────┬──────────┘ │ 1. Establish │
55
+ │ │ foundations │
56
+ ┌──────┼──────┐ │ 2. Choose │
57
+ │ │ │ │ architecture │
58
+ ▼ ▼ ▼ │ 3. Set up docs │
59
+ Healthy Partial Broken │ 4. Plan first │
60
+ │ │ │ │ increment │
61
+ ▼ ▼ ▼ └───────────────────┘
62
+ Improve Reconcile Stabilize
63
+ ```
64
+
65
+ #### Healthy
66
+
67
+ - Code is functional and reasonably structured
68
+ - Approach: improve incrementally
69
+ - Preserve existing patterns
70
+ - Add tests for new changes
71
+ - Document as you go
72
+ - **Skills:** codebase-audit (light), architecture (if changes affect architecture), security (if applicable), testing, [stack], [framework]
73
+
74
+ #### Partial
75
+
76
+ - Code exists but is incomplete, inconsistent, or ambiguous
77
+ - Approach: reconcile before redesign
78
+ - Map what exists to what is intended
79
+ - Identify gaps between implementation and intent
80
+ - Do not rewrite working parts
81
+ - **Skills:** codebase-audit (full), architecture, business-architecture, documentation, [stack], [framework]
82
+
83
+ #### Broken
84
+
85
+ - Code exists but has fundamental problems (security, data integrity, architectural contradictions)
86
+ - Approach: stabilize first
87
+ - Fix highest-risk issues immediately
88
+ - Document problems and fixes as you go
89
+ - Do not introduce new features until stable
90
+ - **Skills:** security (first), codebase-audit (full), architecture, business-architecture, documentation, [stack], [framework], testing
91
+
92
+ ### Phase 2: Technology Detection
93
+
94
+ Inspect these files and directories. Record what you find.
95
+
96
+ #### Programming Language
97
+
98
+ | Signal | Language | Confidence |
99
+ |---|---|---|
100
+ | `Cargo.toml` + `src/main.rs` or `src/lib.rs` | Rust | High |
101
+ | `go.mod` + `.go` files | Go | High |
102
+ | `pom.xml` or `build.gradle` + `.java` files | Java | High |
103
+ | `Gemfile` + `.rb` files | Ruby | High |
104
+ | `*.csproj` or `*.sln` + `.cs` files | C# / .NET | High |
105
+ | `composer.json` + `vendor/` or `artisan` | PHP | High |
106
+ | `package.json` + `.ts` files | TypeScript | High |
107
+ | `package.json` + `.js` files | JavaScript | High |
108
+ | `pyproject.toml` or `requirements.txt` or `setup.py` + `.py` files | Python | High |
109
+ | `index.html` + `.css` only | Static site | High |
110
+
111
+ #### Framework
112
+
113
+ | Signal | Framework | Confidence |
114
+ |---|---|---|
115
+ | `next.config` + `app/` or `pages/` + `package.json` (next) | Next.js | High |
116
+ | `react` in `package.json` + components + no next config | React (SPA) | High |
117
+ | `artisan` + `app/Http/` + `config/` + `resources/views/` | Laravel | High |
118
+ | `manage.py` + `django` in `requirements` + `settings.py` | Django | High |
119
+ | `fastapi` or `starlette` in imports + `main.py` with `FastAPI()` | FastAPI | High |
120
+ | `axum` or `tokio` in `Cargo.toml` + `router` | Axum (Rust) | High |
121
+ | `rails` command + `app/controllers/` + `config/routes.rb` | Ruby on Rails | High |
122
+ | `spring` in `pom.xml`/`build.gradle` + `@RestController` | Spring Boot | High |
123
+
124
+ #### Database
125
+
126
+ | Signal | Database | Confidence |
127
+ |---|---|---|
128
+ | `postgresql` or `postgres` in config | PostgreSQL | High |
129
+ | `mysql` or `mariadb` in config | MySQL / MariaDB | High |
130
+ | `sqlite` in config or `.sqlite` / `.db` files | SQLite | High |
131
+ | `mongo` in config or `mongoose`/`mongodb` imports | MongoDB | High |
132
+ | `redis` in config or `redis://` URLs | Redis | High |
133
+ | `prisma.schema` or `schema.prisma` | Prisma (ORM, reveals DB) | High |
134
+ | `migrations/` or `db/migrate/` or `flyway/` | Migration system (reveals DB) | Medium |
135
+ | `models/` with ORM imports | ORM in use (reveals DB) | Medium |
136
+
137
+ #### Infrastructure
138
+
139
+ | Signal | Infrastructure | Confidence |
140
+ |---|---|---|
141
+ | `Dockerfile` | Docker | High |
142
+ | `docker-compose.yml` or `docker-compose.yaml` | Docker Compose | High |
143
+ | `terraform/` or `.tf` files | Terraform | High |
144
+ | `k8s/`, `kubernetes/`, or `*.yaml` with `Deployment` | Kubernetes | Medium |
145
+ | `vercel.json` or `vercel` in CI | Vercel | High |
146
+ | `.github/workflows/` with deploy steps | GitHub Actions CI/CD | High |
147
+ | `netlify.toml` or `netlify` in CI | Netlify | High |
148
+ | `cloudflare` mentions | Cloudflare | Medium |
149
+ | `nginx` config or `nginx.conf` | Nginx | High |
150
+ | `rails`, `artisan`, `manage.py` with server commands | Built-in dev server | Medium |
151
+
152
+ #### Project Type
153
+
154
+ | Signal | Project Type | Confidence |
155
+ |---|---|---|
156
+ | `payment`, `billing`, `subscription`, `stripe`, `pricing` | SaaS / Commercial | Medium |
157
+ | `marketplace`, `seller`, `buyer`, `listing`, `escrow` | Marketplace | Medium |
158
+ | `product`, `cart`, `checkout`, `inventory` | E-commerce | Medium |
159
+ | `bank`, `account`, `transaction`, `ledger`, `compliance` | Fintech | Medium |
160
+ | `directory`, `listing`, `search`, `category` | Directory | Medium |
161
+ | `auth`, `login`, `session`, `oauth`, `jwt` | Auth system | Medium |
162
+ | `admin`, `dashboard`, `cms`, `content` | CMS / Admin | Medium |
163
+ | `api`, `rest`, `graphql`, `endpoint` + no frontend | API-only | Medium |
164
+ | `crawler`, `scraper`, `spider`, `seed`, `crawl` | Crawler / Scraper | Medium |
165
+ | `mobile`, `react-native`, `flutter`, `expo` | Mobile app | Medium |
166
+ | `worker`, `job`, `queue`, `cron`, `background` | Background processing | Medium |
167
+
168
+ ### Phase 3: Skill Selection
169
+
170
+ After detection, select skills using this algorithm:
171
+
172
+ ```
173
+ Activate always:
174
+ └── 00-orchestrator (this skill)
175
+ └── 01-discovery (to locate and understand the project)
176
+ └── 05-documentation (every agent leaves docs better)
177
+
178
+ Activate if business logic exists or is being added:
179
+ └── 03-business-architecture
180
+
181
+ Activate if architecture decisions are needed:
182
+ └── 04-architecture
183
+
184
+ Activate if existing code needs inspection:
185
+ └── 06-codebase-audit
186
+
187
+ Activate if project handles:
188
+ - user data → 07-security
189
+ - payments → 07-security
190
+ - authentication → 07-security
191
+ - external integrations → 07-security
192
+ - PII → 07-security
193
+
194
+ Activate if code changes are planned:
195
+ └── 08-testing
196
+
197
+ Activate if performance is a concern or changes affect performance:
198
+ └── 09-performance
199
+
200
+ Activate if comprehensive review is needed:
201
+ └── 10-audit (runs 06 + 07 + 04 + 03 in sequence)
202
+
203
+ Activate detected stack skill:
204
+ └── stacks/[detected-language]/
205
+
206
+ Activate detected framework skill:
207
+ └── frameworks/[detected-framework]/
208
+
209
+ Activate detected infrastructure skill:
210
+ └── stacks/[detected-db]/ (if database-specific guidance needed)
211
+ └── stacks/[detected-cache]/ (if cache-specific guidance needed)
212
+ └── stacks/[detected-infra]/ (if infra-specific guidance needed)
213
+ ```
214
+
215
+ ### Phase 4: Workflow Selection
216
+
217
+ Based on the task type, select the appropriate workflow:
218
+
219
+ | Task | Workflow |
220
+ |---|---|
221
+ | New project from scratch | Greenfield workflow (`workflow.md`) |
222
+ | Add feature to existing project | Improve workflow |
223
+ | Fix bug in existing project | Improve workflow + testing |
224
+ | Audit existing project | Audit workflow (`10-audit`) |
225
+ | Refactor existing code | Reconcile workflow (Partial) |
226
+ | Stabilize broken project | Stabilize workflow (Broken) |
227
+ | Document existing project | Documentation workflow (`05-documentation`) |
228
+ | Security review | Security workflow (`07-security`) |
229
+
230
+ ---
231
+
232
+ ## Decision Trees
233
+
234
+ ### "Should I introduce a new technology?"
235
+
236
+ ```
237
+ Is the current technology insufficient for the task?
238
+ ├── NO → Do not introduce new technology
239
+ └── YES
240
+
241
+ Is the gap measurable (performance, capability, maintainability)?
242
+ ├── NO → Do not introduce new technology
243
+ └── YES
244
+
245
+ Is there an existing technology in the stack that can be extended?
246
+ ├── YES → Extend it first. Propose the extension in an ADR.
247
+ └── NO
248
+
249
+ Does the new technology solve a problem the project actually has?
250
+ ├── NO → Do not introduce it
251
+ └── YES
252
+
253
+ Have you documented the decision in an ADR?
254
+ ├── NO → Write the ADR first
255
+ └── YES → Proceed
256
+ ```
257
+
258
+ ### "Should I rewrite this?"
259
+
260
+ ```
261
+ Does the existing code work?
262
+ ├── YES → Do not rewrite. Improve incrementally.
263
+ └── NO
264
+
265
+ Is the problem architectural or implementation?
266
+ ├── Implementation → Fix the implementation
267
+ └── Architectural
268
+
269
+ Can the architecture be adjusted incrementally?
270
+ ├── YES → Adjust incrementally
271
+ └── NO
272
+
273
+ Is a rewrite the only viable path?
274
+ ├── NO → Find another path
275
+ └── YES
276
+
277
+ Have you documented the current problems, the proposed architecture,
278
+ the migration plan, and the rollback plan in an ADR?
279
+ ├── NO → Write the ADR first
280
+ └── YES → Proceed with migration plan
281
+ ```
282
+
283
+ ### "Is this AI-appropriate?"
284
+
285
+ ```
286
+ Is the task deterministic? (same input → same correct output, always)
287
+ ├── YES → Use deterministic tools. Do not use AI.
288
+ │ Examples: data transformation, validation, formatting, testing,
289
+ │ build steps, migrations, config generation
290
+ └── NO (requires judgment, synthesis, or reasoning)
291
+
292
+ Does the task benefit from reasoning?
293
+ ├── NO → Use a simpler heuristic or rule-based approach
294
+ └── YES → AI may be appropriate
295
+ ```
296
+
297
+ ---
298
+
299
+ ## Skill Metadata Schema
300
+
301
+ Every skill file must begin with this YAML header:
302
+
303
+ ```yaml
304
+ skill:
305
+ name: skill-name # kebab-case, matches directory name
306
+ version: X.Y.Z # SemVer
307
+ compatible:
308
+ project_skills: ">=1.0" # min version of this repository
309
+ requires: # skills that must be activated first
310
+ - discovery
311
+ outputs: # artifacts this skill produces
312
+ - path/to/output.md
313
+ conflicts: # skills that should not be active simultaneously
314
+ - unrelated-skill
315
+ ```
316
+
317
+ The orchestrator uses `requires` to order activation and `conflicts` to prevent contradictory skill combinations.
318
+
319
+ ---
320
+
321
+ ## What the Orchestrator Produces
322
+
323
+ After classification and selection, the orchestrator writes:
324
+
325
+ ### `selected-skills.md`
326
+
327
+ ```
328
+ Project: [name]
329
+ State: [greenfield | healthy | partial | broken]
330
+ Detected stack: [language], [framework], [database], [infrastructure]
331
+ Detected domain: [project type]
332
+ Activated skills:
333
+ - 00-orchestrator
334
+ - 01-discovery
335
+ - 05-documentation
336
+ - 03-business-architecture
337
+ - stacks/typescript
338
+ - frameworks/nextjs
339
+ - stacks/postgresql
340
+ Reason for each activation: [brief justification]
341
+ ```
342
+
343
+ ### `project-classification.md`
344
+
345
+ ```
346
+ Project classification
347
+ ======================
348
+ State: [state]
349
+ Rationale: [why this state was chosen]
350
+ Risk level: [low | medium | high]
351
+ Maturity: [new | early | maturing | mature]
352
+ Scale: [solo | small team | medium team | large team | unknown]
353
+ ```
354
+
355
+ ---
356
+
357
+ ## Anti-Patterns
358
+
359
+ The orchestrator must prevent these:
360
+
361
+ 1. **Stack forcing** — selecting a skill because "this should be a Rust project" instead of because Cargo.toml says so
362
+ 2. **Over-skilling** — activating 20 skills for a simple script
363
+ 3. **Under-skilling** — skipping security for a project that handles payments
364
+ 4. **Assuming architecture** — assuming microservices, monolith, serverless, etc. without evidence
365
+ 5. **Assuming business model** — assuming SaaS, marketplace, etc. without evidence
366
+ 6. **Skipping discovery** — jumping to implementation before understanding the project
367
+ 7. **Master prompt fallacy** — trying to use all skills at once instead of selecting the minimum set
368
+ AGENTS_EOF
@@ -0,0 +1,93 @@
1
+ # Decision Tree Reference
2
+
3
+ This file consolidates the decision trees from SKILL.md into a quick-reference format.
4
+
5
+ ## Project State
6
+
7
+ ```
8
+ Existing code?
9
+ ├── NO → Greenfield
10
+ └── YES
11
+
12
+ Is the code working and well-structured?
13
+ ├── YES → Healthy → Improve
14
+ ├── SOME (mixed) → Partial → Reconcile
15
+ └── NO (fundamentally broken) → Broken → Stabilize
16
+ ```
17
+
18
+ ## New Technology
19
+
20
+ ```
21
+ Current technology insufficient?
22
+ ├── NO → Stop
23
+ └── YES
24
+
25
+ Gap measurable?
26
+ ├── NO → Stop
27
+ └── YES
28
+
29
+ Existing technology extendable?
30
+ ├── YES → Extend + ADR
31
+ └── NO
32
+
33
+ New technology solves actual problem?
34
+ ├── NO → Stop
35
+ └── YES
36
+
37
+ ADR written?
38
+ ├── NO → Write ADR
39
+ └── YES → Proceed
40
+ ```
41
+
42
+ ## Rewrite
43
+
44
+ ```
45
+ Code works?
46
+ ├── YES → Do not rewrite
47
+ └── NO
48
+
49
+ Problem type?
50
+ ├── Implementation → Fix implementation
51
+ └── Architectural
52
+
53
+ Incremental adjustment possible?
54
+ ├── YES → Adjust incrementally
55
+ └── NO
56
+
57
+ Rewrite only viable path?
58
+ ├── NO → Find another path
59
+ └── YES
60
+
61
+ ADR with problems + proposal + migration + rollback?
62
+ ├── NO → Write ADR
63
+ └── YES → Proceed
64
+ ```
65
+
66
+ ## AI Appropriateness
67
+
68
+ ```
69
+ Task deterministic?
70
+ ├── YES → Deterministic tools only
71
+ └── NO
72
+
73
+ Benefits from reasoning?
74
+ ├── NO → Heuristic / rule-based
75
+ └── YES → AI may be appropriate
76
+ ```
77
+
78
+ ## Skill Activation
79
+
80
+ ```
81
+ Always: orchestrator, discovery, documentation
82
+ Business logic? → + business-architecture
83
+ Architecture decisions? → + architecture
84
+ Existing code inspection? → + codebase-audit
85
+ User data / payments / auth / PII? → + security
86
+ Code changes planned? → + testing
87
+ Performance concern? → + performance
88
+ Comprehensive review? → + audit (06+07+04+03)
89
+ ───
90
+ Detected language → + stacks/[language]
91
+ Detected framework → + frameworks/[framework]
92
+ Detected infra → + stacks/[infra]
93
+ ```
@@ -0,0 +1,81 @@
1
+ # Project Detection
2
+
3
+ ## Purpose
4
+
5
+ Project detection determines what kind of project this is before any work begins. It is the input to skill selection.
6
+
7
+ ## Detection Process
8
+
9
+ ### 1. Locate the project
10
+
11
+ A repository may contain:
12
+ - A single project at the root
13
+ - A monorepo with multiple projects
14
+ - A partial project (some code, some design)
15
+ - A design-only project (no code yet)
16
+
17
+ Use `01-discovery/SKILL.md` to locate the actual project.
18
+
19
+ ### 2. Detect the technology
20
+
21
+ Use the detection tables in `SKILL.md` (Phase 2) to identify:
22
+ - Programming language
23
+ - Framework and version
24
+ - Database and ORM
25
+ - Cache, queue, search
26
+ - Infrastructure and deployment
27
+ - CI/CD
28
+
29
+ ### 3. Detect the project type
30
+
31
+ Use the project-type signals in `SKILL.md` (Phase 2) to identify:
32
+ - SaaS / commercial
33
+ - Marketplace
34
+ - E-commerce
35
+ - Fintech
36
+ - Directory
37
+ - CMS / admin
38
+ - API-only
39
+ - Crawler / scraper
40
+ - Mobile app
41
+ - Background processing
42
+ - Static site
43
+ - Library / SDK
44
+ - Internal tool
45
+ - Unknown (must not assume)
46
+
47
+ ### 4. Detect the business domain
48
+
49
+ Read the business signals:
50
+ - What is being sold, provided, or tracked?
51
+ - Who are the actors?
52
+ - What are the transactions?
53
+ - What data is central?
54
+
55
+ ### 5. Detect maturity and risk
56
+
57
+ | Signal | Maturity | Risk |
58
+ |---|---|---|
59
+ | No code | New | Low (nothing broken yet) |
60
+ | Code, no tests | Early | Medium (regressions possible) |
61
+ | Code, tests, CI | Maturing | Medium |
62
+ | Code, tests, CI, docs, ADR | Mature | Low |
63
+ | Security issues found | Any | High |
64
+ | Data integrity issues | Any | High |
65
+ | No auth on sensitive endpoints | Any | High |
66
+ | Hardcoded secrets | Any | High |
67
+
68
+ ### 6. Detect team and scale
69
+
70
+ | Signal | Scale |
71
+ |---|---|
72
+ | Single developer, no CI | Solo / small |
73
+ | Team, some process | Small team |
74
+ | Multiple teams, CI/CD, monitoring | Medium team |
75
+ | Explicit scaling infrastructure, on-call | Large team |
76
+
77
+ If no signals are available, record "unknown" — do not assume.
78
+
79
+ ## Output
80
+
81
+ The detection produces a structured summary that the orchestrator uses for skill selection. See `SKILL.md` for the output format.
@@ -0,0 +1,87 @@
1
+ # Skill Selection
2
+
3
+ ## Algorithm
4
+
5
+ ```
6
+ 1. Run discovery → locate the project
7
+ 2. Detect technology → language, framework, database, infrastructure
8
+ 3. Detect project type → domain and business model
9
+ 4. Classify state → greenfield / healthy / partial / broken
10
+ 5. Select core skills → always-on + contextually required
11
+ 6. Select stack skills → detected language, framework, infrastructure
12
+ 7. Select workflow → based on task type and project state
13
+ 8. Write selected-skills.md
14
+ ```
15
+
16
+ ## Always-On Skills
17
+
18
+ These are active for every project, every session:
19
+
20
+ | Skill | Why |
21
+ |---|---|
22
+ | 00-orchestrator | This skill — the decision engine |
23
+ | 01-discovery | Locate and understand the project |
24
+ | 05-documentation | Every agent leaves docs better |
25
+
26
+ ## Conditional Core Skills
27
+
28
+ | Condition | Skill |
29
+ |---|---|
30
+ | Business logic exists or is being added | 03-business-architecture |
31
+ | Architecture decisions needed | 04-architecture |
32
+ | Existing code needs inspection | 06-codebase-audit |
33
+ | User data, payments, auth, PII, external integrations | 07-security |
34
+ | Code changes planned | 08-testing |
35
+ | Performance concern or changes affecting performance | 09-performance |
36
+ | Comprehensive review requested | 10-audit |
37
+
38
+ ## Stack Skills
39
+
40
+ Activated by detection only:
41
+
42
+ | Detected | Skill |
43
+ |---|---|
44
+ | JavaScript | stacks/javascript |
45
+ | TypeScript | stacks/typescript |
46
+ | Python | stacks/python |
47
+ | PHP | stacks/php |
48
+ | Rust | stacks/rust |
49
+ | Go | stacks/go |
50
+ | Java | stacks/java |
51
+ | Ruby | stacks/ruby |
52
+ | C# / .NET | stacks/dotnet |
53
+ | React | frameworks/react |
54
+ | Next.js | frameworks/nextjs |
55
+ | Laravel | frameworks/laravel |
56
+ | Django | frameworks/django |
57
+ | FastAPI | frameworks/fastapi |
58
+ | Axum | frameworks/axum |
59
+ | Ruby on Rails | frameworks/rails |
60
+ | Spring Boot | frameworks/spring |
61
+
62
+ ## Infrastructure Skills
63
+
64
+ | Detected | Skill |
65
+ |---|---|
66
+ | PostgreSQL | stacks/postgresql (or database adapter) |
67
+ | Redis | stacks/redis |
68
+ | Docker | stacks/docker |
69
+ | AWS | stacks/aws |
70
+ | Vercel | stacks/vercel |
71
+
72
+ ## Selection Rules
73
+
74
+ 1. **Minimum set.** Activate only what is needed. A 200-line script needs README + discovery, not 15 skills.
75
+ 2. **Detection over assumption.** Never select a stack skill without detection evidence.
76
+ 3. **Security is conditional but important.** Skip it for a static site. Never skip it for a project handling payments or user data.
77
+ 4. **Documentation is mandatory.** Always active. Non-negotiable.
78
+ 5. **Testing is conditional on code changes.** No code changes = no testing skill needed. Planning a change = testing skill needed.
79
+ 6. **Audit is a composite.** 10-audit activates 06, 07, 04, and 03 in sequence. Do not activate all four individually if 10-audit is selected.
80
+
81
+ ## Anti-Patterns
82
+
83
+ - Selecting all skills "just in case"
84
+ - Selecting a stack skill before detecting the stack
85
+ - Skipping security for a project that handles user data
86
+ - Skipping documentation "because it's a small change"
87
+ - Activating framework skill when no framework is detected