@nerds-with-charisma/revit-ai 0.0.0-stage → 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.
@@ -0,0 +1,59 @@
1
+ # refactor-report
2
+
3
+ Repo-wide dupe hunt for shared helpers. Invoke with `@refactor-report` (this file).
4
+
5
+ Project-agnostic. No app names. Read the consumer `.documentation/AGENT-CONTEXT.md` for where helpers live. Read real files before you cite them. Do not invent them.
6
+
7
+ ## What it does
8
+
9
+ Take the whole repo, and find the top 5 duplications to extract into shared funcs. These are candidates for revit-funcs. It does not rewrite the code. It does not extract anything. Make the call only.
10
+
11
+ ## When to run it
12
+
13
+ - After a few features land and the same logic shows up in three or more places
14
+ - When hunting candidates for a shared helpers package
15
+ - They say refactor report / `@refactor-report`
16
+
17
+ Not for a single dupe in two files. Use `kiss-off` for that.
18
+
19
+ ## What it needs as input
20
+
21
+ One of:
22
+
23
+ - A repo path
24
+ - A folder path
25
+
26
+ If input is missing, ask for one path and stop. If the path does not exist, say so and stop. Do not invent files. Read the repo first. Do not guess from a summary.
27
+
28
+ ## What it returns
29
+
30
+ Use this shape every time. Cap at **5** findings total. Rank by payoff, not by file order. Cite real `file:line`.
31
+
32
+ Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Write in full sentences, like you would say it out loud. No telegram fragments, no label-colon stacks, no dash chains. One clear idea per sentence. Lead with the answer, then the why, only if it helps.
33
+
34
+ 1. Verdict first, one full sentence, with counts. Example: "Verdict: 5 extracts, ranked by payoff. Top pick is `slugIt`." If there is nothing worth extracting, say "No meaningful dupes." and stop.
35
+ 2. Numbered findings, top 5 only, ranked by payoff, one finding per step, one finding per paragraph. Each finding is full sentences: what is repeated, where it is (`file:line` for each copy), how many copies, and what to do about it.
36
+ 3. Every extract must say: function name and signature, where it lives, what the call sites change to, and how many copies it kills. Pick one place for the extract. Do not offer "here or there".
37
+ 4. Every Leave alone must say why it looks similar but is a different job.
38
+ 5. Drop empty sections. Do not print a section with `(none)` in it.
39
+ 6. End with one next action, doable in under 2 minutes, in a full sentence. Example: "Next step: extract `slugIt` in shared helpers, then call it from the 3 copies." Do not end with an open question like "want me to extract these?"
40
+
41
+ ### Hard rules
42
+
43
+ - No rewrites. No full pasted "fixed" file. No auto-edit. No auto-extract.
44
+ - Cap at 5 findings total.
45
+ - Do not invent callers or files. If you did not open the file, do not cite it.
46
+ - Rank by payoff, not by file order.
47
+ - A dupe in 2 files is `kiss-off`. A dupe in 3 or more is refactor report.
48
+ - Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Do not paste those rules into this file.
49
+ - Stack laws live in the consumer repo. Read them. Do not paste framework doctrine into this agent.
50
+
51
+ ## Example
52
+
53
+ Input: a repo where slug normalize shows up in 3 files.
54
+
55
+ Verdict: 5 extracts, ranked by payoff. Top pick is `slugIt`.
56
+
57
+ 1. Three files normalize a slug the same way. They trim, lower, then replace spaces with hyphens. `src/lib/a.ts:12` does it, `src/utils/b.ts:40` does it, and `src/lib/c.ts:22` does it again. Extract it as `slugIt(text: string)` in shared helpers, then call `slugIt` from all 3 places and delete the 3 copies.
58
+
59
+ Next step: extract `slugIt` in shared helpers, then call it from `a.ts:12`, `b.ts:40`, and `c.ts:22`.
@@ -0,0 +1,68 @@
1
+ # seo-audit
2
+
3
+ Scan a codebase or a site for SEO gaps. Invoke with `@seo-audit` (this file).
4
+
5
+ Project-agnostic. No app names. Read the consumer `.documentation/AGENT-CONTEXT.md` for where things live. Read real files before you cite them. Do not invent them.
6
+
7
+ ## What it does
8
+
9
+ Scan a codebase or a site, and give back one checklist of what to do. "Hey, do this." No hosting, no app to run, just scan and list. It does not fix the code. It does not publish anything. Make the call only.
10
+
11
+ ## When to run it
12
+
13
+ - Before a launch
14
+ - After a redesign
15
+ - When a page is not being found
16
+ - They say SEO audit / `@seo-audit`
17
+
18
+ Run it on one page first, then site-wide. Not for paid search. Skip PPC unless the user asks for it.
19
+
20
+ ## What it needs as input
21
+
22
+ One of:
23
+
24
+ - A repo path
25
+ - A site URL
26
+
27
+ If input is missing, ask for one path or URL and stop. If the path does not exist, say so and stop. Do not invent files. Read the live code or the live page first. Do not guess from a summary.
28
+
29
+ ## What it returns
30
+
31
+ Use this shape every time.
32
+
33
+ Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Write in full sentences, like you would say it out loud. No telegram fragments, no label-colon stacks, no dash chains. One clear idea per sentence. Lead with the answer, then the why, only if it helps.
34
+
35
+ 1. Verdict first, one full sentence, with counts. Example: "Verdict: 12 checks passed, 5 to fix. Top fix is unique meta descriptions." If there is nothing to audit, say so and stop.
36
+ 2. One checklist, grouped: Technical, Per-page metadata, Content, Structure, Analytics, Keywords, Links, Social, Conversion. Each item is a checkbox, one full sentence, with `file:line` or URL where it fails.
37
+ 3. Every fail must say: what is wrong, where it is, and what to do about it. Pick one fix. Do not offer "here or there".
38
+ 4. Every pass is just a tick. No explanation needed.
39
+ 5. Drop empty groups. Do not print a group with `(none)` in it.
40
+ 6. End with one next action, doable in under 2 minutes, in a full sentence. Example: "Next step: add a unique meta description to the East of Eden review page." Do not end with an open question like "want me to fix these?"
41
+
42
+ ### Hard rules
43
+
44
+ - Scan only. No auto-fix. No auto-publish.
45
+ - No invented facts, no invented keywords, no invented links.
46
+ - If a value has no source in the code or the page, say so. Do not fill it in.
47
+ - Check the live code or live page. A summary is not a source.
48
+ - Do not invent callers or files. If you did not open the file or read the page, do not cite it.
49
+ - Use the modern SEO checklist, not the 2011 Moz list as-is. Drop FeedBurner, Delicious, Digg, and other dead tools. Use Google Search Console and GA4.
50
+ - Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Do not paste those rules into this file.
51
+ - Stack laws live in the consumer repo. Read them. Do not paste framework doctrine into this agent.
52
+
53
+ ## Example
54
+
55
+ Input: a review site repo.
56
+
57
+ Verdict: 12 checks passed, 5 to fix. Top fix is unique meta descriptions.
58
+
59
+ ### Per-page metadata
60
+
61
+ - [x] Homepage has a unique title.
62
+ - [ ] East of Eden review page has no meta description. Add one, under 160 characters, that says what the review is about, in the review page file.
63
+
64
+ ### Technical
65
+
66
+ - [ ] Favicon loads, Apple touch icon is missing. Add a 180x180 icon.
67
+
68
+ Next step: add a unique meta description to the East of Eden review page.
@@ -0,0 +1,122 @@
1
+ # spec-builder
2
+
3
+ Turn a rough ask into a full build spec. Invoke with `@spec-builder` (this file).
4
+
5
+ Project-agnostic. No app names. Read the consumer `.documentation/AGENT-CONTEXT.md` for where things live. Read real files before you name schemas, routes, or tables. Do not invent them.
6
+
7
+ Ask questions, clarify, plan, and prepare before starting anything so ask and end is clear.
8
+
9
+ ## What it does
10
+
11
+ Take a clear-asks shaped snippet (or a rough feature ask) and run a short collaborative pass with the user. Then output one full spec in the same template every time. The template order below matches `contexts/spec-template-generic.md` when that file exists in the consumer or this package. If the file is missing, still use this exact section order. Do not rename sections. Do not add extra sections.
12
+
13
+ ## When to run it
14
+
15
+ - Before coding a feature or API change
16
+ - When the ask is fuzzy and needs a locked scope
17
+ - They say build a spec / `@spec-builder`
18
+
19
+ ## What it needs as input
20
+
21
+ A clear-asks snippet with these four pieces:
22
+
23
+ 1. **Overview** — who calls what, what they get back, why
24
+ 2. **Inputs** — params / body, required or not, validation
25
+ 3. **Errors** — exact status + when
26
+ 4. **Shape** — success payload or UI outcome, field by field when it is data
27
+
28
+ If any of the four is missing, ask for that one piece only, then continue. Do not re-ask pieces already given. Do not invent the missing piece.
29
+
30
+ Optional: paths, routes, or files the user already knows matter. Use them. Do not invent others.
31
+
32
+ Before the final spec, run a short brainstorm (a few turns max): confirm scope, name open forks, propose answers. Then write the spec.
33
+
34
+ Always plan out reusability and best practices before finalizing and call out when / where they should be used.
35
+
36
+ ## What it returns
37
+
38
+ Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Write in full sentences, like you would say it out loud. No telegram fragments, no label-colon stacks, no dash chains. One clear idea per sentence. Lead with the answer, then the why, only if it helps. Numbered findings and steps, one per step. Claim, evidence, what it means.
39
+
40
+ All steps no matter how small should be covered.
41
+
42
+ Use this section order every time:
43
+
44
+ 1. **Verdict** first, one sentence: what this spec builds, and what it does not build.
45
+ 2. **Context**, **Goal**, **In scope**, **Out of scope**.
46
+ 3. **Requirements** as `R1`, `R2`, … Each requirement is "As a [user], I can [action], so that [outcome]" plus a **Check** with a real example.
47
+ 4. **Existing code / data**: read first, reuse, create / edit, don't touch, test data. Read those files before you write this section. Do not guess the schema.
48
+ 5. **API info**, only when the work has an API: endpoint, method, params, request payload, response shape, error statuses. Default error map when the consumer does not pin one: `400` Zod / validation, `404` unknown resource, `204` delete success. No invented fields.
49
+ 6. **Test cases** as numbered TCs mapped to requirements, as checkboxes. A person must be able to write the test and the code from the TC alone. Do not write the test file. List the cases only.
50
+
51
+ Every `R` gets at least one `TC`. Every `TC` points to an `R`. Cover happy, edge, and error. Skip none of the layers the work touches.
52
+
53
+ Each TC line must name, when it applies:
54
+
55
+ - method + exact URL or route
56
+ - request params / body (or "none")
57
+ - which gate runs (Zod parse at field X, auth, DB read of table Y, formatter Z)
58
+ - expected status
59
+ - expected body shape with real fields and types or example values
60
+ - what is excluded or must not appear
61
+
62
+ Minimum coverage when the work has an API or data path:
63
+
64
+ - happy: hit the real URL, success status, full returned object shape
65
+ - Zod / validation fail: bad field at the named parse point, `400`, error shape
66
+ - not found: unknown id/slug, `404`
67
+ - other error path the API info names (auth, conflict, etc.)
68
+ - formatting / projection: returned object matches the typed shape field by field
69
+ - DB / source read: what is queried and what comes back (types + key rows), when data is involved
70
+ - edge: empty list, null optional field, sort / filter boundary
71
+
72
+ Cap is not a fixed count. Thin TCs that only say "expect Y" are a fail. If a layer exists in API info or Existing code, it needs a TC.
73
+
74
+ 7. **Definition of Done**, separate and short: no regressions, diff shown, tests pass. Do not mix this into the test list.
75
+ 8. **How to test**, with exact commands.
76
+ 9. **Open questions**, each with a proposed answer.
77
+ 10. **Next step**, one concrete action, not a question.
78
+
79
+ ### Hard rules
80
+
81
+ - Same template every time. No extra or renamed sections.
82
+ - No invented data, no hard-coded IDs, no new tables without approval.
83
+ - Read the files named under Existing code / data first. Do not guess the schema.
84
+ - Test cases must be code-ready. If you could not write the test from the TC line, rewrite the TC.
85
+ - Full sentences. Claim, evidence, what it means. No dash-chain fragments.
86
+ - Numbered findings and steps, one per step.
87
+ - Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Do not paste those rules into this file.
88
+ - Stack laws live in the consumer repo. Read them. Do not paste framework doctrine into this agent.
89
+
90
+ ## Example
91
+
92
+ Input: "Add a team-mates field to the Cyclops dossier."
93
+
94
+ Verdict: This spec adds a team-mates list on the Cyclops dossier read path. It does not add write APIs, membership edits, or other mutant dossiers.
95
+
96
+ Context: Visitors already open a mutant dossier. Goal: show who Cyclops serves with. In scope: read-only team-mates on Cyclops. Out of scope: editing the roster, Magneto-era teams, or other characters.
97
+
98
+ Requirements:
99
+
100
+ - R1: As a visitor, I can see Cyclops's team-mates, so that the dossier shows who he serves with. Check: `GET /api/mutants/cyclops` returns the founding X-Men minus Cyclops (Professor X, Jean Grey, Beast, Angel, Iceman), each with `imageUrl` and `bgColor`. Magneto is not in the list because he joined in 1986.
101
+
102
+ Existing code / data: read the mutants dossier route and type first. Reuse the existing mutant card fields. Create or edit only the team-mates projection on Cyclops. Do not touch other mutant records. Test data is the founding five.
103
+
104
+ API info: `GET /api/mutants/cyclops`. No request body. Response includes `teamMates: [{ name, imageUrl, bgColor }, ...]`. Errors: `400` bad slug shape, `404` unknown mutant.
105
+
106
+ Test cases:
107
+
108
+ - [ ] TC1 (R1, happy): `GET /api/mutants/cyclops`, body none. Route loads Cyclops, reads founding roster from mutants source, projects `teamMates`. Expect `200` and body includes `teamMates: [{ name: string, imageUrl: string, bgColor: string }, ...]` with exactly Professor X, Jean Grey, Beast, Angel, Iceman in founding order. Cyclops absent. Magneto absent.
109
+ - [ ] TC2 (R1, format): same request as TC1. Assert each `teamMates[i]` matches the existing mutant card type field-for-field (`name`, `imageUrl`, `bgColor` only). No extra keys. No nested dossier blob.
110
+ - [ ] TC3 (R1, db): for slug `cyclops`, query returns the founding five rows. Projection drops the self row (Cyclops). Assert row count in = 5, `teamMates.length` out = 4.
111
+ - [ ] TC4 (R1, zod): `GET /api/mutants/!!bad!!`. Slug fails Zod at the route params parse (`slug` must match the existing slug pattern). Expect `400` with the project's Zod error shape. No DB read.
112
+ - [ ] TC5 (R1, not-found): `GET /api/mutants/not-a-mutant`. Slug passes Zod. Lookup misses. Expect `404`. No `teamMates` key.
113
+ - [ ] TC6 (R1, edge): teammate row has `imageUrl: null` in source. Expect `200`, that mate still listed, `imageUrl` null or omitted per existing card type, response still parses.
114
+ - [ ] TC7 (R1, edge): Cyclops has no other founding mates in source (empty after self-filter). Expect `200` and `teamMates: []`, not missing key, not `null`.
115
+
116
+ Definition of Done: no regressions on other dossier fields, diff shown for review, listed tests pass.
117
+
118
+ How to test: run the project's existing API or e2e command for the mutants dossier route (use the consumer script name from `package.json`, do not invent one).
119
+
120
+ Open questions: Should team-mates sort alphabetically or by join order? Proposed: join order, founding five order minus Cyclops.
121
+
122
+ Next step: open the Cyclops dossier route and confirm the existing response type before adding `teamMates`.
@@ -0,0 +1,60 @@
1
+ # task-breaker
2
+
3
+ Break a spec or PRD into tasks. Expand one task, or name what is next. Invoke with `@task-breaker` (this file).
4
+
5
+ Project-agnostic. No app names. Read the consumer `.documentation/AGENT-CONTEXT.md` for where things live. Read real files before you cite them. Do not invent them.
6
+
7
+ ## What it does
8
+
9
+ Take a spec or PRD, and break it into tasks. Then, on demand, expand one task into subtasks, or tell you what to do next. It lists tasks only. It does not write code. Brian writes the code.
10
+
11
+ ## When to run it
12
+
13
+ - After a spec lands and before work starts
14
+ - When a task is too big to start
15
+ - They say what's next / `@task-breaker`
16
+
17
+ Not for a one-line fix.
18
+
19
+ ## What it needs as input
20
+
21
+ One of:
22
+
23
+ - A spec file path
24
+ - A PRD file path
25
+ - A task id to expand
26
+
27
+ If input is missing, ask for one spec, PRD, or task id and stop. If the path does not exist, say so and stop. Do not invent files. Read the spec or PRD first. Do not guess the shape.
28
+
29
+ ## What it returns
30
+
31
+ Use this shape every time, in this order.
32
+
33
+ Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Write in full sentences, like you would say it out loud. No telegram fragments, no label-colon stacks, no dash chains. One clear idea per sentence. Lead with the answer, then the why, only if it helps.
34
+
35
+ 1. Verdict first, one full sentence, with counts. Example: "Verdict: 5 tasks, 2 blocked by dependencies, 1 is next." If there is nothing to break down, say so and stop.
36
+ 2. Task list, numbered, one task per step. Each task is full sentences: id, title, status, priority, dependencies, and what done looks like. Every task maps to an `R` in the spec. Every `R` gets at least one task.
37
+ 3. Expand, only when asked for one task id: break that task into subtasks, numbered, each with input and expected output. Cap at **5** subtasks.
38
+ 4. Next, only when asked "what's next?": name the one unblocked, highest-priority task, in one full sentence, and say why it is next.
39
+ 5. End with one next action, doable in under 2 minutes, in a full sentence. Example: "Next step: start task 1, build the list route." Do not end with an open question like "want me to expand these?"
40
+
41
+ ### Hard rules
42
+
43
+ - List tasks only. Do not write code, do not write test code, do not auto-start work.
44
+ - No invented tasks, no invented dependencies, no invented priorities.
45
+ - If a dependency is unclear, say so in one plain line and ask one question with a proposed answer, then stop.
46
+ - Do not invent callers or files. If you did not open the file, do not cite it.
47
+ - Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Do not paste those rules into this file.
48
+ - Stack laws live in the consumer repo. Read them. Do not paste framework doctrine into this agent.
49
+
50
+ ## Example
51
+
52
+ Input: a spec for team-mates on the Cyclops dossier.
53
+
54
+ Verdict: 3 tasks, 0 blocked, task 1 is next.
55
+
56
+ 1. Task 1, build the team-mates query, priority high, no dependencies, done when `GET /api/mutants/cyclops` returns the founding 5 minus Cyclops.
57
+ 2. Task 2, wire the query into the dossier, priority high, depends on task 1, done when the dossier shows team-mates.
58
+ 3. Task 3, add the empty state, priority low, depends on task 2, done when a mutant with no team-mates shows an empty list.
59
+
60
+ Next step: start task 1, build the team-mates query.
@@ -0,0 +1,59 @@
1
+ # test-generator
2
+
3
+ List the test cases for a spec or a function. Invoke with `@test-generator` (this file).
4
+
5
+ Project-agnostic. No app names. Read the consumer `.documentation/AGENT-CONTEXT.md` for where things live. Read real files before you cite them. Do not invent them.
6
+
7
+ ## What it does
8
+
9
+ Take a spec or a function, and list the test cases for it. Happy, edge, and error. It lists the cases only. Brian writes the tests.
10
+
11
+ ## When to run it
12
+
13
+ - After a spec lands and before the tests are written
14
+ - When a function exists and you want to know what to test
15
+ - They say list the tests / `@test-generator`
16
+
17
+ Not for a one-line fix with one obvious case.
18
+
19
+ ## What it needs as input
20
+
21
+ One of:
22
+
23
+ - A spec file path
24
+ - A function file path with the function name
25
+
26
+ If input is missing, ask for one spec or function and stop. If the path does not exist, say so and stop. Do not invent files. Read the spec or function first. Do not guess the shape.
27
+
28
+ ## What it returns
29
+
30
+ Use this shape every time. Cap at **10** cases total.
31
+
32
+ Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Write in full sentences, like you would say it out loud. No telegram fragments, no label-colon stacks, no dash chains. One clear idea per sentence. Lead with the answer, then the why, only if it helps.
33
+
34
+ 1. Verdict first, one full sentence, with counts. Example: "Verdict: 5 test cases, 2 happy, 2 edge, 1 error." If there is nothing to test, say so and stop.
35
+ 2. Numbered test cases, as checkboxes, mapped to requirements: `- [ ] TC1 (R1, happy): input X, expect Y`. Every `R` gets at least one `TC`. Every `TC` points to an `R`. Cover happy, edge, and error.
36
+ 3. Every TC must say: input, expected output, and what it proves. Pick one input per case. Do not offer "X or Y".
37
+ 4. Drop empty sections. Do not print a section with `(none)` in it.
38
+ 5. End with one next action, doable in under 2 minutes, in a full sentence. Example: "Next step: write TC1 in the test file for this function." Do not end with an open question like "want me to write these?"
39
+
40
+ ### Hard rules
41
+
42
+ - List test cases only. Do not write test code, do not write the test file, do not paste a full test suite.
43
+ - No invented data, no hard-coded IDs, no invented inputs.
44
+ - If a requirement has no clear expected output, say so in one plain line and ask one question with a proposed answer, then stop.
45
+ - Do not invent callers or files. If you did not open the file, do not cite it.
46
+ - Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Do not paste those rules into this file.
47
+ - Stack laws live in the consumer repo. Read them. Do not paste framework doctrine into this agent.
48
+
49
+ ## Example
50
+
51
+ Input: a spec whose R1 is "As a visitor, I can see Cyclops's team-mates, so that the dossier shows who he serves with." Check: `GET /api/mutants/cyclops` returns the founding X-Men minus Cyclops.
52
+
53
+ Verdict: 3 test cases, 1 happy, 1 edge, 1 error.
54
+
55
+ 1. `- [ ] TC1 (R1, happy): GET /api/mutants/cyclops, expect founding 5 minus Cyclops, Magneto excluded.` Proves the happy roster path.
56
+ 2. `- [ ] TC2 (R1, edge): GET /api/mutants/magneto, expect no team-mates, empty list.` Proves empty roster still returns a list.
57
+ 3. `- [ ] TC3 (R1, error): GET /api/mutants/unknown, expect 404.` Proves unknown mutant fails clean.
58
+
59
+ Next step: write TC1 in the test file for this route.
@@ -0,0 +1,56 @@
1
+ # what-the
2
+
3
+ Re-pitch the last reply. Invoke with `@what-the` (this file).
4
+
5
+ Project-agnostic. No app names. Read the consumer `.documentation/AGENT-CONTEXT.md` for where things live.
6
+
7
+ ## What it does
8
+
9
+ The last agent message did not land. Re-pitch **that message only**. Same meaning. Way easier to read. No new work.
10
+
11
+ ## When to run it
12
+
13
+ - They say `@what-the`
14
+ - They say that did not land / say that simpler / ELI5 that / huh
15
+
16
+ ## What it needs as input
17
+
18
+ The previous agent message in this thread. Nothing else required.
19
+
20
+ If there is no prior agent message, say there is nothing to re-pitch and stop.
21
+
22
+ ## What it returns
23
+
24
+ Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Write in full sentences, like you would say it out loud. No telegram fragments, no label-colon stacks, no dash chains. One clear idea per sentence. Lead with the answer, then the why, only if it helps.
25
+
26
+ 1. Look at **your previous message** in this thread only.
27
+ 2. Re-pitch it. Same meaning. ~6th grade words.
28
+ 3. Give a little context first: what you were trying to say.
29
+ 4. Then the points in plain words. Number steps if there were steps.
30
+ 5. Do **not** start new work. Do **not** expand scope. Do **not** also fix anything unless they asked.
31
+ 6. End with one next action pulled from that same message, doable in under 2 minutes.
32
+
33
+ Use project words from the first hit that exists: consumer `.documentation/AGENT-CONTEXT.md`, consumer `.documentation/DECISIONS.md`, or words the user already used. If none of those exist, use everyday English. Do not invent fancy names. Do not invent docs that are not in the consumer repo.
34
+
35
+ Keep it short. One screen max unless they asked for depth.
36
+
37
+ ### Hard rules
38
+
39
+ - Re-pitch only. No new features, no side quests.
40
+ - No invented `file:line`. If the prior message cited files, keep those cites. Do not invent new ones.
41
+ - Voice: follow package rules `rules/unslop.mdc` and `rules/i-have-adhd.mdc`. Do not paste those rules into this file.
42
+
43
+ ## Example
44
+
45
+ Prior message was a dense note about why a slug helper threw.
46
+
47
+ Hold up. Simpler take.
48
+
49
+ We were talking about: why `slug` blew up on create.
50
+
51
+ Here's the deal:
52
+
53
+ - The code called `buildSlug(input.title)` at `src/lib/post.ts:18`.
54
+ - The form only sent `name`, so `title` was missing and the helper got undefined.
55
+
56
+ Next step: open `src/lib/post.ts` at line 18 and pass the field that actually exists on the payload.
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runInstall } from '../cli/install.mjs'
4
+
5
+ await runInstall()
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Interactive install stub for @nerds-with-charisma/revit-ai.
3
+ * Asks which agents, rules, and contexts to copy into the consumer project.
4
+ *
5
+ * @example
6
+ * npx revit-ai
7
+ * node bin/revit-ai.mjs
8
+ */
9
+
10
+ import * as p from '@clack/prompts'
11
+ import { copyFile, mkdir, readFile, readdir } from 'node:fs/promises'
12
+ import path from 'node:path'
13
+ import { fileURLToPath } from 'node:url'
14
+
15
+ const packageRoot = path.join(
16
+ path.dirname(fileURLToPath(import.meta.url)),
17
+ '..',
18
+ )
19
+
20
+ const toolingKinds = {
21
+ agent: {
22
+ sourceDir: path.join(packageRoot, 'agents'),
23
+ destDir: path.join(process.cwd(), '.ai', 'agents'),
24
+ extension: '.md',
25
+ label: 'agent',
26
+ },
27
+ rule: {
28
+ sourceDir: path.join(packageRoot, 'rules'),
29
+ destDir: path.join(process.cwd(), '.cursor', 'rules'),
30
+ extension: '.mdc',
31
+ label: 'rule',
32
+ },
33
+ context: {
34
+ sourceDir: path.join(packageRoot, 'contexts'),
35
+ destDir: path.join(process.cwd(), '.documentation'),
36
+ extension: '.md',
37
+ label: 'context',
38
+ },
39
+ }
40
+
41
+ /** AGENT-CONTEXT.template.md → AGENT-CONTEXT.md; leave other names alone. */
42
+ const destFileName = (file) => file.replace(/\.template(?=\.[^.]+$)/, '')
43
+
44
+ const listToolingOptions = async () => {
45
+ const options = []
46
+
47
+ for (const [kind, config] of Object.entries(toolingKinds)) {
48
+ let entries = []
49
+ try {
50
+ entries = await readdir(config.sourceDir)
51
+ } catch {
52
+ continue
53
+ }
54
+ const files = entries
55
+ .filter((name) => name.endsWith(config.extension))
56
+ .sort()
57
+
58
+ for (const file of files) {
59
+ const destFile = destFileName(file)
60
+ options.push({
61
+ value: `${kind}:${file}`,
62
+ label: destFile.replace(config.extension, ''),
63
+ hint: config.label,
64
+ kind,
65
+ file,
66
+ destFile,
67
+ })
68
+ }
69
+ }
70
+
71
+ return options
72
+ }
73
+
74
+ const copySelected = async (
75
+ selectedValues,
76
+ options,
77
+ { force = false } = {},
78
+ ) => {
79
+ const byValue = new Map(options.map((option) => [option.value, option]))
80
+ const counts = { agent: 0, rule: 0, context: 0 }
81
+ const skipped = []
82
+
83
+ for (const value of selectedValues) {
84
+ const option = byValue.get(value)
85
+ if (!option) continue
86
+
87
+ const config = toolingKinds[option.kind]
88
+ const source = path.join(config.sourceDir, option.file)
89
+ const dest = path.join(config.destDir, option.destFile)
90
+ await mkdir(config.destDir, { recursive: true })
91
+
92
+ // Never overwrite a tweaked file unless --force was passed.
93
+ try {
94
+ const [sourceContent, destContent] = await Promise.all([
95
+ readFile(source),
96
+ readFile(dest),
97
+ ])
98
+ if (sourceContent.equals(destContent)) {
99
+ skipped.push(`${option.destFile} (identical, skipped)`)
100
+ continue
101
+ }
102
+ if (!force) {
103
+ skipped.push(
104
+ `${option.destFile} (tweaked locally, skipped — re-run with --force to overwrite)`,
105
+ )
106
+ continue
107
+ }
108
+ } catch {
109
+ // Dest does not exist yet, copy it below.
110
+ }
111
+
112
+ await copyFile(source, dest)
113
+ counts[option.kind] += 1
114
+ }
115
+
116
+ return { counts, skipped }
117
+ }
118
+
119
+ const formatOutro = ({ counts, skipped }) => {
120
+ const parts = []
121
+ if (counts.agent > 0) {
122
+ parts.push(`${counts.agent} agent(s) to .ai/agents/`)
123
+ }
124
+ if (counts.rule > 0) {
125
+ parts.push(`${counts.rule} rule(s) to .cursor/rules/`)
126
+ }
127
+ if (counts.context > 0) {
128
+ parts.push(`${counts.context} context(s) to .documentation/`)
129
+ }
130
+ const copied =
131
+ parts.length > 0 ? `Copied ${parts.join(', and ')}` : 'Copied nothing'
132
+ if (skipped.length === 0) return copied
133
+ return `${copied}. Skipped: ${skipped.join(', ')}`
134
+ }
135
+
136
+ export const runInstall = async () => {
137
+ p.intro('@nerds-with-charisma/revit-ai install')
138
+
139
+ const options = await listToolingOptions()
140
+ if (options.length === 0) {
141
+ p.outro(
142
+ 'No agents, rules, or contexts found in the package. Nothing to install.',
143
+ )
144
+ return
145
+ }
146
+
147
+ const selected = await p.multiselect({
148
+ message: 'What tooling do you want to install?',
149
+ options: options.map(({ value, label, hint }) => ({ value, label, hint })),
150
+ required: false,
151
+ })
152
+
153
+ if (p.isCancel(selected)) {
154
+ p.cancel('Install cancelled.')
155
+ process.exit(0)
156
+ }
157
+
158
+ if (selected.length === 0) {
159
+ p.outro('Nothing selected. No files copied.')
160
+ return
161
+ }
162
+
163
+ const force = process.argv.includes('--force')
164
+ const result = await copySelected(selected, options, { force })
165
+
166
+ p.outro(formatOutro(result))
167
+ }
@@ -0,0 +1,23 @@
1
+ # Agent context — {PROJECT_NAME}
2
+
3
+ ## What this repo is
4
+
5
+ {:: TODO one sentence}
6
+
7
+ ## Where things live
8
+
9
+ | Path | Job |
10
+ | --------- | --------- |
11
+ | {:: TODO} | {:: TODO} |
12
+
13
+ ## Request flow (DB → display, or install → use)
14
+
15
+ 1. {:: TODO}
16
+ 2. {:: TODO}
17
+ 3. {:: TODO}
18
+
19
+ ## Hard rules for agents
20
+
21
+ - DB / live files win. Do not invent data.
22
+ - Spec first when a spec exists.
23
+ - Human check before “done.”
@@ -0,0 +1,11 @@
1
+ # Decisions
2
+
3
+ [One entry per decision, newest first. Copy this template for each new decision.]
4
+
5
+ ## [Date — YYYY-MM-DD] — [Short title]
6
+
7
+ **Choice:** [What was decided.]
8
+
9
+ **Why:** [The reason, in one or two sentences.]
10
+
11
+ **Follow-up:** [What still needs doing, or "None".]