ship-anything 0.1.0 → 0.1.1

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 (30) hide show
  1. package/content/.ship-anything/adapters/codex.md +20 -9
  2. package/content/.ship-anything/policies/authorization.md +12 -6
  3. package/content/.ship-anything/registry.yaml +242 -0
  4. package/content/.ship-anything/templates/project-instructions.md +21 -4
  5. package/content/agents/architecture-agent.md +1 -1
  6. package/content/agents/backend-agent.md +1 -1
  7. package/content/agents/frontend-agent.md +1 -1
  8. package/content/agents/integration-agent.md +1 -1
  9. package/content/agents/mobile-agent.md +1 -1
  10. package/content/agents/orchestrator.md +8 -1
  11. package/content/agents/performance-agent.md +1 -1
  12. package/content/agents/product-director.md +1 -1
  13. package/content/agents/qa-agent.md +1 -1
  14. package/content/agents/research-agent.md +1 -1
  15. package/content/agents/security-agent.md +1 -1
  16. package/content/skills/chrome-devtools-debugging/SKILL.md +141 -0
  17. package/content/skills/craft-anything-analysis/SKILL.md +140 -0
  18. package/content/skills/library-docs-lookup/SKILL.md +132 -0
  19. package/content/skills/playwright-cli-testing/SKILL.md +141 -0
  20. package/content/skills/release-management/SKILL.md +1 -1
  21. package/content/skills/reverse-engineering/SKILL.md +14 -7
  22. package/content/skills/spec-driven-development/SKILL.md +136 -0
  23. package/content/skills/systematic-debugging/SKILL.md +135 -0
  24. package/content/workflows/build-anything.md +5 -0
  25. package/content/workflows/reverse-engineer.md +18 -5
  26. package/package.json +3 -2
  27. package/src/cli.js +1 -0
  28. package/src/commands/init.js +26 -9
  29. package/src/commands/update.js +1 -1
  30. package/src/lib/profiles.js +46 -0
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: spec-driven-development
3
+ description: >-
4
+ Runs a feature or product through specification before code: a short project constitution
5
+ of non-negotiable principles, then spec → plan → tasks → implement → converge, with a
6
+ gate between each phase. Maps every phase onto SHIP ANYTHING files (product brief,
7
+ architecture doc and ADRs, plan.yaml, task contracts) so no extra tooling is needed. Use
8
+ for new products or multi-task features where requirements, design and work split must
9
+ stay consistent; not for one-file fixes.
10
+ license: MIT
11
+ metadata:
12
+ category: product-intelligence
13
+ version: "0.1.0"
14
+ agents: [product-director, architecture-agent, orchestrator]
15
+ ---
16
+
17
+ # Spec-driven development
18
+
19
+ ## Purpose
20
+
21
+ Make the specification the source of truth that the plan, the tasks and the code are
22
+ checked against. Each phase produces a file the next phase reads, and each hand-over passes
23
+ a gate, so drift between "what we meant", "what we designed" and "what we built" shows up
24
+ before QA rather than after.
25
+
26
+ ## When to use
27
+
28
+ - A new product, or a feature that needs more than one task contract or agent.
29
+ - Work where several agents run in parallel and need one shared definition of done.
30
+ - Projects with standing rules (regulated data, accessibility level, stack limits) that
31
+ every feature must respect.
32
+ - An existing project whose features keep missing requirements in QA.
33
+
34
+ Do not use when:
35
+ - The change is L1 (one file, self-evident check): do it directly.
36
+ - The question is still *what product to build*: run `product-discovery` first; its brief
37
+ is this skill's starting spec.
38
+ - Only acceptance criteria are missing: `requirements-analysis` alone is enough.
39
+
40
+ ## Inputs
41
+
42
+ - The user request, verbatim; any existing `docs/product-brief.md`, `docs/architecture.md`,
43
+ `docs/adr/**` and `.ship-anything/state/plan.yaml`.
44
+ - Standing constraints: policies in `.ship-anything/policies/`, user-stated rules,
45
+ compliance needs.
46
+
47
+ ## Procedure
48
+
49
+ 1. **Constitution (once per project).** Write `docs/constitution.md`: 3–7 principles, each
50
+ a MUST or MUST NOT with a one-line reason and how it is checked (e.g. "MUST meet WCAG
51
+ 2.2 AA — axe scan in CI"). Add a version and date. Changing a principle needs an ADR
52
+ (`.ship-anything/templates/architecture-decision.md`) and a version bump. Keep it short;
53
+ preferences that are not enforceable do not belong here.
54
+ 2. **Specify.** Fill `docs/product-brief.md` from `.ship-anything/templates/product-brief.md`:
55
+ users, problem, MVP versus enhancements, prioritised journeys (each independently
56
+ testable), acceptance criteria. Describe *what* and *why*; leave stack choices out.
57
+ Run `requirements-analysis` for FR/NFR/AC numbering. Mark every gap inline as
58
+ `NEEDS CLARIFICATION: <question>` instead of guessing.
59
+ 3. **Gate: spec ready.** Each journey has acceptance criteria with a verification method;
60
+ each open marker is resolved by a batched question to the user, or turned into an
61
+ `ASSUMPTION:` recorded in `.ship-anything/state/decisions.md`. Blocking questions stay
62
+ under "Open questions (blocking only)". No principle in the constitution is contradicted.
63
+ 4. **Plan.** `architecture-agent` writes `docs/architecture.md` (stack, modules, data model,
64
+ API contracts) with `architecture-planning`, plus one ADR per significant choice.
65
+ 5. **Gate: constitution check.** Before and after design, list each principle with
66
+ pass / violation. A violation stays only with an ADR stating why it is needed and which
67
+ simpler option was rejected.
68
+ 6. **Tasks.** The orchestrator writes `.ship-anything/state/plan.yaml` (waves, owners,
69
+ dependencies) and one task contract per task from `.ship-anything/templates/task-contract.yaml`.
70
+ Group tasks by journey so each journey can ship on its own; put tasks in the same wave
71
+ only when their `owns` globs do not overlap. Copy the relevant AC IDs into each contract.
72
+ 7. **Gate: consistency analysis** (read-only, before any code). Check that every AC maps to
73
+ at least one task, every task maps to an AC or a principle, terms mean the same thing in
74
+ brief, architecture and contracts, and no task contradicts an ADR. Fix the documents, not
75
+ the code, then re-run the check.
76
+ 8. **Implement.** Specialists execute contracts wave by wave; QA verifies each task
77
+ independently per `testing-and-qa` and `.ship-anything/policies/status-model.md`.
78
+ 9. **Converge.** Compare the codebase with the brief, architecture and contracts. Grade each
79
+ gap (constitution violation or missing journey first), add a task contract per gap to
80
+ `plan.yaml`, and repeat implement → converge until no gap remains.
81
+ 10. **Keep the spec alive.** When behaviour changes later, change the brief (and ADRs) in
82
+ the same task as the code; a spec that lags the code is a defect.
83
+
84
+ ## Decision rules
85
+
86
+ | Situation | Action |
87
+ |---|---|
88
+ | No constitution and a one-off prototype | Skip step 1; record "no constitution" in `decisions.md` |
89
+ | Spec mentions frameworks or libraries | Move them to the plan phase as ADR candidates |
90
+ | More open questions than the user will answer at once | Ask only the blocking ones; default the rest as assumptions |
91
+ | Plan violates a principle | ADR with justification, or change the plan; never silently |
92
+ | Consistency check finds an AC with no task | Add a task before implementation starts |
93
+ | Converge finds work outside the spec | Do not build it; record as an enhancement in the brief |
94
+ | User asks for the upstream `specify` CLI | Optional; see Tools. Do not run both processes in one project |
95
+
96
+ ## Tools
97
+
98
+ - SHIP ANYTHING templates: `product-brief.md`, `architecture-decision.md`, `plan.yaml`,
99
+ `task-contract.yaml` in `.ship-anything/templates/`.
100
+ - Search for leftover markers: `rg -n "NEEDS CLARIFICATION" docs/`.
101
+ - Trace check: `rg -n "AC-[0-9]+" docs/product-brief.md .ship-anything/state/` to compare
102
+ AC IDs in the brief with those in contracts.
103
+ - Optional, not required: GitHub's Spec Kit (`specify` CLI, installed with
104
+ `uv tool install specify-cli`; slash commands `/speckit-constitution`, `/speckit-specify`,
105
+ `/speckit-plan`, `/speckit-tasks`, `/speckit-implement`, `/speckit-converge`). It writes its
106
+ own commands and templates into agent folders and competes with our orchestrator; its
107
+ registry entry is `spec-kit` (REFERENCE). Use one process per project.
108
+ - Attribution: phase structure, constitution idea and cross-artifact checks informed by
109
+ github/spec-kit (MIT), read at release v1.4.5 (tag commit 6ba8bee). Text is our own.
110
+
111
+ ## Quality standards
112
+
113
+ - The constitution is short, each principle is checkable, and amendments have ADRs.
114
+ - No `NEEDS CLARIFICATION` marker survives into the tasks phase.
115
+ - Every AC traces to a task and every task to an AC or principle.
116
+ - Each gate's result is written down (in `decisions.md` or the plan), not just passed.
117
+ - The brief describes behaviour; the architecture describes how; contracts describe who.
118
+
119
+ ## Common failures
120
+
121
+ - A constitution full of preferences ("clean code") that no gate can check.
122
+ - Specs that are plans in disguise (database tables, framework names in the brief).
123
+ - Skipping the consistency check because "the tasks look right".
124
+ - Treating the spec as frozen while the code moves on, then QA testing against stale ACs.
125
+ - Running Spec Kit's slash commands and SHIP ANYTHING's orchestrator in the same project.
126
+
127
+ ## Outputs
128
+
129
+ - `docs/constitution.md` (versioned), `docs/product-brief.md`, `docs/architecture.md`, ADRs.
130
+ - `.ship-anything/state/plan.yaml` and task contracts with AC IDs.
131
+ - Gate results and assumptions in `.ship-anything/state/decisions.md`.
132
+
133
+ ## Done when
134
+
135
+ - Every gate has a recorded pass, every MVP task is VERIFIED, and a final converge pass
136
+ finds no gap between the brief, the architecture and the code.
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: >-
4
+ Finds the root cause of a bug, failing test, crash, flaky behaviour or performance
5
+ regression before any fix is written: reproduce first, keep a hypothesis log, bisect and
6
+ minimise, prove the cause with one-variable experiments, pin it with a failing regression
7
+ test, then verify the fix with fresh evidence. Includes explicit stop-and-escalate
8
+ rules. Use when the cause of a defect is unknown or a previous fix did not work.
9
+ license: MIT
10
+ metadata:
11
+ category: quality
12
+ version: "0.1.0"
13
+ agents: [qa-agent, backend-agent, frontend-agent, performance-agent]
14
+ ---
15
+
16
+ # Systematic debugging
17
+
18
+ ## Purpose
19
+
20
+ Replace guess-and-patch with a short, recorded investigation. A fix is only worth
21
+ shipping when the cause is known, a test showed the defect before the change, and fresh
22
+ output shows it gone after. This skill owns the *diagnosis*; `regression-prevention` owns
23
+ making the fix permanent (impact, sibling call sites, data fixes).
24
+
25
+ ## When to use
26
+
27
+ - A bug, failing test, build break, crash or wrong output whose cause is not yet known.
28
+ - A flaky test or an intermittent production error.
29
+ - A performance regression with a known good and a known bad version.
30
+ - A fix was already tried and the symptom came back or moved.
31
+
32
+ Do not use when:
33
+ - The cause is obvious and confirmed (a typo the error message points at): fix it under
34
+ `regression-prevention`.
35
+ - The work is a new feature with no defect: use the implementation skill.
36
+ - The task is only to report a bug: use the bug report format in `testing-and-qa`.
37
+
38
+ ## Inputs
39
+
40
+ - Symptom: exact error text, stack trace, failing test name, or metric with values.
41
+ - Expected behaviour and where it is defined (acceptance criterion, spec, earlier version).
42
+ - Environment: commit SHA, runtime versions, OS, config and data shape (secrets by name).
43
+ - A known good point if one exists: commit, release tag, dependency version, date.
44
+
45
+ ## Procedure
46
+
47
+ 1. **Read the evidence fully.** Whole error, whole stack trace, warnings before it, exit
48
+ code. Note file paths, line numbers and error codes.
49
+ 2. **Reproduce.** Get a command that shows the failure on a clean checkout. Record how
50
+ often it fails (e.g. `for i in $(seq 20); do <cmd> || echo FAIL; done`). If it will not
51
+ reproduce, collect more data (logs, versions, inputs); do not change code yet.
52
+ 3. **Start the hypothesis log** in the task report (`.ship-anything/state/tasks/<id>.md`):
53
+ one row per idea with hypothesis, prediction, experiment, result, verdict. Write the
54
+ row before running the experiment.
55
+ 4. **Look at what changed.** `git log --oneline <good>..<bad>`, `git diff <good> <bad>`,
56
+ lockfile diffs, config and environment differences between where it works and where
57
+ it fails.
58
+ 5. **Bisect** when a good and a bad point exist: `git bisect start <bad> <good>`, then
59
+ `git bisect run <command that exits non-zero on failure>`; finish with `git bisect reset`.
60
+ For dependencies, bisect versions the same way. For a test polluted by another test,
61
+ halve the set of tests that run before it until one remains.
62
+ 6. **Minimise.** Shrink the failing input, data set, config or test until removing any
63
+ part makes the failure disappear. A small repro often names the cause by itself.
64
+ 7. **Instrument boundaries** in multi-part systems (CI → build → deploy, client → API →
65
+ DB): log what enters and leaves each part, once, to find the first part where data
66
+ goes wrong. Remove the temporary logging afterwards.
67
+ 8. **Trace back to the source.** From the point where a bad value is seen, walk up the
68
+ callers until you find where it was first produced. Fix there, not where it surfaced.
69
+ 9. **Test one hypothesis at a time.** Smallest change that would confirm or refute it;
70
+ one variable per experiment; revert experiments that refute. Never stack guesses.
71
+ 10. **Pin it.** Write a regression test at the lowest layer that reproduces the defect.
72
+ Run it and save the failing output as "before" evidence.
73
+ 11. **Fix the cause** with the smallest change. No refactors or extras in the same change.
74
+ 12. **Verify with fresh evidence.** Run the new test (passes), the affected suite and the
75
+ original repro command. For flaky bugs repeat the step-2 loop and compare rates.
76
+ Then hand off to `regression-prevention` steps for impact and sibling call sites.
77
+
78
+ ## Decision rules
79
+
80
+ | Situation | Action |
81
+ |---|---|
82
+ | Cannot reproduce after gathering data | Report "not reproduced" with what was tried; add logging or monitoring; do not ship a speculative fix |
83
+ | Known good and bad versions | Bisect before reading code at length |
84
+ | Intermittent failure | Look for timing, ordering, shared state, randomness; wait for the condition, not a fixed sleep |
85
+ | Hypothesis refuted | Revert the experiment; log it; form a new one from the evidence |
86
+ | Three fixes have failed | Stop; the design may be wrong. Write up the log and escalate to `architecture-agent` or the orchestrator |
87
+ | Cause lies in a dependency or external service | Minimal repro, pin or work around, file upstream; record in `decisions.md` |
88
+ | Fix needs a schema or data change | Switch to the database protocol in `regression-prevention` |
89
+ | Investigation exceeds the contract's `budget.max_iterations` | Mark BLOCKED with the log; escalate per `agents/orchestrator.md` |
90
+
91
+ Escalate to the user only for missing access, production data, or a design change that is
92
+ expensive to reverse; otherwise escalate to the orchestrator with the hypothesis log.
93
+
94
+ ## Tools
95
+
96
+ - Version control: `git bisect run`, `git log -S<string>`, `git blame -L <a>,<b> <file>`.
97
+ - Runtime: the language debugger (`node --inspect`, `python -m pdb`, `dlv`, `lldb`),
98
+ browser devtools, structured logs and traces (`observability`).
99
+ - Performance: profilers from `performance-optimization`; compare good and bad profiles.
100
+ - Test runners in single-test and repeat modes (e.g. `vitest run <file>`, `pytest -x -k`,
101
+ `go test -run <name> -count=20`).
102
+ - Attribution: approach informed by the systematic-debugging and
103
+ verification-before-completion skills in obra/superpowers (MIT), read at release v7.0.2
104
+ (commit 22f0b46). Text is our own. Its SessionStart hook and always-on context injection
105
+ are not used; SHIP ANYTHING's orchestrator and policies stay in charge.
106
+
107
+ ## Quality standards
108
+
109
+ - A reproduction command exists, or "not reproduced" is stated with what was tried.
110
+ - The hypothesis log shows each experiment and its result, including the failed ones.
111
+ - The root cause is one sentence that names the origin, not the symptom.
112
+ - The regression test failed before the fix and passes after, with both outputs recorded.
113
+ - Every claim of "fixed" comes from a command run after the final change.
114
+
115
+ ## Common failures
116
+
117
+ - Changing code before reproducing, then being unable to tell if the change helped.
118
+ - Trying several fixes at once and keeping whichever combination went green.
119
+ - Adding a sleep or a retry that hides a race instead of removing it.
120
+ - Fixing where the error appeared instead of where the bad value was made.
121
+ - A fourth and fifth attempt on the same idea instead of stopping to question the design.
122
+ - Leaving debug logging or experiment code in the final diff.
123
+
124
+ ## Outputs
125
+
126
+ - Hypothesis log and root-cause sentence in the task report.
127
+ - Regression test with "before" (failing) and "after" (passing) output.
128
+ - The minimal fix, and the verification commands with their results.
129
+ - Escalation note when stopped: what is known, what was ruled out, what is needed.
130
+
131
+ ## Done when
132
+
133
+ - The cause is identified with evidence, a regression test pins it, the fix passes fresh
134
+ verification, and temporary instrumentation is removed; or the work is escalated with a
135
+ complete hypothesis log.
@@ -149,6 +149,11 @@ WEB's contract excludes `apps/web/src/three/**` explicitly; otherwise serialize
149
149
 
150
150
  - Routing gate: each deliverable traced to a workflow; unmatched deliverables listed as risks.
151
151
  - Plan gate: no `depends_on` cycles; waves ≤ `max_agents`; shared files owned by orchestrator.
152
+ - Coverage gate: every `required_agents` entry of each composed workflow is assigned a task or
153
+ explicitly DESCOPED with a reason in `decisions.md` (a design-led brief with no `ux-agent`,
154
+ `threejs-agent` or `motion-agent` task is a plan defect).
155
+ - Visual gate (design-led or creative briefs): key screens and the hero experience are rendered
156
+ and reviewed at 1440/1024/768/390 before backend or portal scope expands beyond its foundation.
152
157
  - Downstream gates are those of the composed workflows (QA, security, performance, release).
153
158
 
154
159
  ## Deliverables
@@ -35,8 +35,8 @@ competitor (→ `clone-existing-product`, public surface only); the code is well
35
35
 
36
36
  - Target(s): repo paths, binaries/artifacts the user possesses, API base URLs of
37
37
  environments the user controls (test/staging preferred), sample files.
38
- - User's authorization statement: ownership, license terms, contract, or lawful
39
- interoperability basis (the user's legal call, recorded verbatim).
38
+ - One line from the user: "I own this" / "I'm allowed to analyse it" (or the request already says so).
39
+ It is the user's legal call; record it verbatim.
40
40
  - Questions to answer (scope); without them, default to: architecture, data flow, interfaces.
41
41
 
42
42
  ## Agents
@@ -56,12 +56,25 @@ Tools: `git log --stat`, `rg`, dependency graphs, language-appropriate static an
56
56
  debuggers/disassemblers on artifacts the user owns, HTTP capture of the user's own
57
57
  traffic to environments they control, schema inference from captured samples.
58
58
 
59
+ Optional upstream tool: `craft-anything` (see `.ship-anything/registry.yaml`, disabled until
60
+ reviewed under `.ship-anything/policies/external-skills.md`), driven through the
61
+ `craft-anything-analysis` skill. Its CLI/MCP tools produce evidence records with confidence
62
+ and limitations that map onto RE-01/RE-02 and the observed/inferred tags. Use it after RE-00
63
+ records a one-line authorization ("I own this" / "I'm allowed to analyse it") in
64
+ `decisions.md`. Clean room and Deep mode (decompiler, Ghidra, Frida, packet capture) may both
65
+ run on the user's own machine; commit or snapshot first. Its rebuild loop (Study → Build →
66
+ Check → Ready) is allowed only for software the user owns or may recreate. Global `setup`
67
+ needs the user's OK (it edits global agent config and pre-approves tools); prefer per-project
68
+ MCP config. Never bypass DRM, logins, licence checks or anti-cheat, and never use the adapters
69
+ that skip permission prompts. Products the user does not own go through
70
+ `clone-existing-product` with original branding.
71
+
59
72
  ## Task graph
60
73
 
61
74
  ```
62
75
  id agent objective depends_on wave owns
63
- RE-00 orchestrator AUTHORIZATION GATE: record basis, targets, - 1 .ship-anything/state/decisions.md
64
- allowed methods, forbidden methods
76
+ RE-00 orchestrator AUTHORIZATION LINE: date, target, user's - 1 .ship-anything/state/decisions.md
77
+ words (one line per target)
65
78
  RE-01 research-agent repo map / artifact inventory; entry RE-00 2 docs/research/system-map.md
66
79
  points, build, dependencies
67
80
  RE-02 research-agent interface capture: APIs, CLI, file formats, RE-00 2 docs/research/interfaces/**
@@ -126,7 +139,7 @@ change work is composed as a new plan (improve/modernise), not implied.
126
139
 
127
140
  | Failure | Recovery |
128
141
  |---|---|
129
- | Authorization unclear or partial | BLOCKED for out-of-scope targets; continue only on clearly authorized ones |
142
+ | No ownership/permission line for a target | Ask the user one short question; continue on targets that have one |
130
143
  | System cannot run locally | Document from static analysis; tag claims inferred; mark RE-05 BLOCKED with environment needs |
131
144
  | Obfuscated/encrypted component | Document its interface only; never defeat protections |
132
145
  | Contradictory observations | Record both with conditions; add a test that discriminates them |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ship-anything",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Install SHIP ANYTHING agents, skills and workflows into any project for Claude Code, Codex, OpenCode, Cursor, Gemini CLI or any Agent Skills-compatible agent.",
5
5
  "license": "MIT",
6
6
  "author": "SHIP ANYTHING contributors",
@@ -30,7 +30,8 @@
30
30
  "scripts": {
31
31
  "test": "node --test",
32
32
  "bundle-content": "node scripts/bundle-content.mjs",
33
- "prepack": "node scripts/bundle-content.mjs"
33
+ "prepack": "node scripts/bundle-content.mjs",
34
+ "postpack": "node -e \"require('fs').rmSync('content',{recursive:true,force:true})\""
34
35
  },
35
36
  "keywords": [
36
37
  "agent-skills",
package/src/cli.js CHANGED
@@ -39,6 +39,7 @@ const OPTIONS = {
39
39
  json: { type: 'boolean' },
40
40
  cwd: { type: 'string' },
41
41
  skill: { type: 'string', short: 's' },
42
+ profile: { type: 'string', short: 'p' },
42
43
  category: { type: 'string' },
43
44
  content: { type: 'boolean' },
44
45
  'allow-scripts': { type: 'boolean' },
@@ -6,10 +6,12 @@ import { findContentRoot, listAgents, listSkills, walk } from '../lib/content.js
6
6
  import { plan, apply } from '../lib/installer.js';
7
7
  import { detectAgents } from '../lib/detect.js';
8
8
  import { confirm, ui } from '../lib/ui.js';
9
+ import { PROFILES, parseProfiles, resolveProfile } from '../lib/profiles.js';
9
10
 
10
11
  const SA = '.ship-anything';
11
12
 
12
- export function buildOps(root, target, agentIds) {
13
+ export function buildOps(root, target, agentIds, profileNames = ['full']) {
14
+ const profile = resolveProfile(root, profileNames);
13
15
  const ops = [];
14
16
  const add = (p, content, extra = {}) => ops.push({ path: p, content, kind: 'file', ...extra });
15
17
  const copyTree = (srcDir, destDir, filter = () => true) => {
@@ -34,11 +36,16 @@ export function buildOps(root, target, agentIds) {
34
36
 
35
37
  // 2. Skills: copy each skill folder once per distinct skills directory.
36
38
  const disabled = readDisabled(target);
39
+ // With a profile, only its skills go to native dirs (preloaded by the host); the rest go to
40
+ // .ship-anything/skills/, an on-demand library read by path when a contract names a skill.
37
41
  const skills = listSkills(root).filter((s) => s.data && !disabled.has(s.id));
42
+ const native = profile.full ? skills : skills.filter((s) => profile.skills.has(s.id));
43
+ const library = profile.full ? [] : skills.filter((s) => !profile.skills.has(s.id));
38
44
  const skillDirs = [...new Set([...agentIds.map((id) => ADAPTERS[id].skillsDir), '.agents/skills'])];
39
45
  for (const dir of skillDirs) {
40
- for (const s of skills) copyTree(s.dir, path.posix.join(dir, s.id));
46
+ for (const s of native) copyTree(s.dir, path.posix.join(dir, s.id));
41
47
  }
48
+ for (const s of library) copyTree(s.dir, `${SA}/skills/${s.id}`);
42
49
 
43
50
  // 3. Native agent definitions.
44
51
  for (const id of agentIds) {
@@ -46,7 +53,10 @@ export function buildOps(root, target, agentIds) {
46
53
  if (!spec) continue;
47
54
  // Cursor also loads .claude/agents/ — avoid duplicate subagents when both are installed.
48
55
  if (id === 'cursor' && agentIds.includes('claude')) continue;
49
- for (const a of agents) add(path.posix.join(spec.dir, `${a.id}${spec.ext}`), spec.render(a));
56
+ for (const a of agents) {
57
+ if (!profile.full && !profile.agents.has(a.id)) continue;
58
+ add(path.posix.join(spec.dir, `${a.id}${spec.ext}`), spec.render(a));
59
+ }
50
60
  }
51
61
 
52
62
  // 4. Root instruction files as managed blocks (never clobbers user content).
@@ -61,7 +71,8 @@ export function buildOps(root, target, agentIds) {
61
71
  };
62
72
  const template = fs.readFileSync(path.join(root, SA, 'templates', 'project-instructions.md'), 'utf8');
63
73
  const dirList = skillDirs.map((d) => `\`${d}/\``).join(', ');
64
- ops.push({ path: 'AGENTS.md', kind: 'block', blockId: 'core', content: template.replaceAll('{{SKILLS_DIRS}}', dirList).replaceAll('{{AGENTS}}', agentIds.join(', ')) });
74
+ ops.push({ path: 'AGENTS.md', kind: 'block', blockId: 'core', content: template.replaceAll('{{SKILLS_DIRS}}', dirList).replaceAll('{{AGENTS}}', agentIds.join(', '))
75
+ .replaceAll('{{PROFILE}}', profileNames.join(', ')) });
65
76
  for (const id of agentIds) {
66
77
  const instr = ADAPTERS[id].instructions;
67
78
  if (instr) ops.push({ path: instr.path, kind: 'block', blockId: 'core', content: instr.render(ctx) });
@@ -110,12 +121,13 @@ export async function run(args, opts) {
110
121
  agentIds = detected.length ? detected : ['generic'];
111
122
  ui.info(`No --agent given; ${detected.length ? `detected: ${detected.join(', ')}` : 'no agents detected, using generic (AGENTS.md + .agents/skills)'}`);
112
123
  }
113
- const ops = buildOps(root, target, agentIds);
124
+ const profileNames = parseProfiles(opts.profile);
125
+ const ops = buildOps(root, target, agentIds, profileNames);
114
126
  const result = plan(target, ops, { force: !!opts.force });
115
127
  const counts = summarize(result.actions);
116
128
 
117
129
  ui.heading(`ship-anything init → ${target}`);
118
- ui.info(`agents: ${agentIds.map((i) => ADAPTERS[i].label).join(', ')}`);
130
+ ui.info(`agents: ${agentIds.map((i) => ADAPTERS[i].label).join(', ')} · profile: ${profileNames.join(', ')}`);
119
131
  printPlan(result.actions, opts.verbose);
120
132
  ui.info(`create ${counts.create} · update ${counts.update} · append ${counts.append} · unchanged ${counts.unchanged} · conflicts ${counts.conflict}`);
121
133
 
@@ -126,7 +138,7 @@ export async function run(args, opts) {
126
138
  const ok = await confirm('Apply these changes?');
127
139
  if (!ok) { ui.warn('Aborted. Re-run with --yes to apply non-interactively, or --dry-run to preview.'); return 1; }
128
140
  }
129
- const tx = apply(target, result, { command: 'init', agents: agentIds, manifest: { agents: agentIds } });
141
+ const tx = apply(target, result, { command: 'init', agents: agentIds, manifest: { agents: agentIds, profile: profileNames } });
130
142
  ui.ok(`Applied transaction ${tx.id}: ${tx.created.length} created, ${tx.updated.length} updated.`);
131
143
  if (counts.conflict) ui.warn(`${counts.conflict} file(s) skipped to protect local changes. Review them or re-run with --force (backups are kept).`);
132
144
  ui.info('Undo with: ship-anything rollback');
@@ -154,9 +166,14 @@ function printPlan(actions, verbose) {
154
166
  }
155
167
  }
156
168
 
157
- export const help = `ship-anything init [--agent claude|codex|opencode|cursor|gemini|generic|all[,..]] [--dry-run] [--yes] [--force] [--verbose] [--cwd <dir>]
169
+ export const help = `ship-anything init [--agent claude|codex|opencode|cursor|gemini|generic|all[,..]] [--profile full|web|mobile|desktop|creative|reverse[,..]] [--dry-run] [--yes] [--force] [--verbose] [--cwd <dir>]
158
170
 
159
171
  Installs SHIP ANYTHING into the current project. Idempotent: unchanged files are skipped,
160
172
  files you modified are never overwritten (unless --force, which keeps a backup), and root
161
173
  instruction files get a marked block instead of being replaced. Undo with \`ship-anything rollback\`.
162
- Agents: ${AGENT_IDS.join(', ')}`;
174
+ Agents: ${AGENT_IDS.join(', ')}
175
+
176
+ --profile limits what your agent preloads at startup to the agents and skills that kind of project
177
+ needs (default: full). Everything else is kept in .ship-anything/skills/ and read only on demand.
178
+ Switching to a smaller profile later does not delete files; run \`ship-anything rollback\` first.
179
+ Profiles: ${Object.keys(PROFILES).join(', ')}`;
@@ -10,7 +10,7 @@ import * as init from './init.js';
10
10
  export async function run(args, opts) {
11
11
  const manifest = loadManifest(opts.cwd ?? process.cwd());
12
12
  if (!manifest.agents?.length) { ui.error('No installation found. Run `ship-anything init` first.'); return 1; }
13
- return init.run(args, { ...opts, agent: opts.agent ?? manifest.agents.join(',') });
13
+ return init.run(args, { ...opts, agent: opts.agent ?? manifest.agents.join(','), profile: opts.profile ?? manifest.profile?.join(',') });
14
14
  }
15
15
 
16
16
  export const help = `ship-anything update [--dry-run] [--yes] [--force]
@@ -0,0 +1,46 @@
1
+ // Skill profiles: install only the agents and skills a kind of project needs into the agent's
2
+ // native directories (whose skill descriptions the host loads at every session start). Every
3
+ // other skill is still copied to .ship-anything/skills/ as an on-demand library that agents read
4
+ // by path only when a task contract names it, so nothing is lost and startup context stays small.
5
+ import { listAgents, listSkills, listWorkflows } from './content.js';
6
+
7
+ // Workflows are not expanded through `composes` on purpose: fullstack-platform composes
8
+ // mobile and desktop, which would pull nearly everything into a "web" profile.
9
+ export const PROFILES = {
10
+ full: null,
11
+ web: ['website', 'web-app', 'fullstack-platform', 'improve-existing-project'],
12
+ mobile: ['mobile-app', 'web-app', 'improve-existing-project'],
13
+ desktop: ['desktop-app', 'improve-existing-project'],
14
+ creative: ['website', '3d-product', 'video-production'],
15
+ reverse: ['reverse-engineer', 'clone-existing-product', 'legacy-modernization', 'improve-existing-project'],
16
+ };
17
+ const CORE_WORKFLOWS = ['build-anything', 'product-discovery', 'security-remediation', 'production-release'];
18
+ const CORE_AGENTS = ['orchestrator', 'qa-agent', 'security-agent', 'documentation-agent', 'release-agent'];
19
+ const CORE_CATEGORIES = ['efficiency'];
20
+
21
+ export function parseProfiles(value) {
22
+ const names = String(value ?? 'full').split(',').map((s) => s.trim()).filter(Boolean);
23
+ const unknown = names.filter((n) => !(n in PROFILES));
24
+ if (unknown.length) throw new Error(`Unknown profile: ${unknown.join(', ')}. Use one or more of: ${Object.keys(PROFILES).join(', ')}`);
25
+ return names.length ? names : ['full'];
26
+ }
27
+
28
+ /** Returns { full, agents:Set, skills:Set } for the selected profile names. */
29
+ export function resolveProfile(root, names) {
30
+ if (names.includes('full')) return { full: true, agents: null, skills: null };
31
+ const workflows = listWorkflows(root).filter((w) => w.data);
32
+ const wanted = new Set([...CORE_WORKFLOWS, ...names.flatMap((n) => PROFILES[n])]);
33
+ const agents = new Set(CORE_AGENTS);
34
+ const skills = new Set();
35
+ for (const w of workflows.filter((x) => wanted.has(x.id))) {
36
+ for (const a of [...(w.data.required_agents ?? []), ...(w.data.optional_agents ?? [])]) agents.add(a);
37
+ for (const s of w.data.required_skills ?? []) skills.add(s);
38
+ }
39
+ for (const a of listAgents(root).filter((x) => x.data && agents.has(x.id))) {
40
+ for (const s of a.data.required_skills ?? []) skills.add(s); // optional skills stay on demand
41
+ }
42
+ for (const s of listSkills(root).filter((x) => x.data)) {
43
+ if (CORE_CATEGORIES.includes(s.data.metadata?.category)) skills.add(s.id);
44
+ }
45
+ return { full: false, agents, skills };
46
+ }