adsa-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ # Fix: compile the guide examples in CI
2
+
3
+ **Dimension:** Docs freshness · **Size:** M · **Repo:** {{name}} · **Stack:** {{stack}}
4
+
5
+ Every code block in the guides is a promise. Compile them and find out which ones
6
+ the system no longer keeps.
7
+
8
+ ## What to build
9
+
10
+ A script that extracts every TypeScript or TSX block from `{{guidesDir}}` and type
11
+ checks it against the **built** package, then fails with file and line numbers.
12
+
13
+ 1. Extract fenced blocks tagged `tsx`, `ts`, `jsx` or `js`.
14
+ 2. Most blocks are fragments with no imports. Build a per-file import registry:
15
+ collect the imports from that guide's own Import section and prepend them to
16
+ every fragment in the same file. This is what makes wrong props detectable.
17
+ 3. Unknown identifiers that are clearly out of scope become `declare const X: any`
18
+ so the check stays about props and imports, not about the surrounding app.
19
+ 4. Allow an explicit escape hatch — a comment above the block with a reason — and
20
+ print how many blocks are skipped so the number cannot creep up quietly.
21
+ 5. Report as `path:line — message`, and exit non-zero on the first failure.
22
+
23
+ ## Expect to find
24
+
25
+ Real bugs, not formatting: icons that no longer exist, compound APIs that were
26
+ never implemented, required props missing from examples, imports pointing at the
27
+ wrong subpath. In our own run this flagged 13 guides out of 59 on the first pass.
28
+
29
+ ## Verify the check itself
30
+
31
+ Break one example on purpose — rename a prop to something that cannot exist — and
32
+ confirm the script fails with the right line. A check that never fails is not a check.
33
+
34
+ ## Done when
35
+
36
+ - Every block compiles or is explicitly skipped with a stated reason.
37
+ - CI runs it on every pull request.
@@ -0,0 +1,32 @@
1
+ # Fix: page-level patterns
2
+
3
+ **Dimension:** Patterns · **Size:** L · **Repo:** {{name}}
4
+
5
+ Components tell an agent what exists. Patterns tell it what to build. Without them
6
+ every agent re-invents page structure, and no two screens come out the same.
7
+
8
+ ## Where the content comes from
9
+
10
+ Do not invent patterns. Take four or five real pages that already exist in the
11
+ product — the ones that repeat — and describe what they actually are. A list page,
12
+ a settings form, a detail view, an empty state, a wizard. If the design lives in
13
+ Figma, read the real frames rather than imagining the layout.
14
+
15
+ ## What each pattern needs
16
+
17
+ - **When to use it**, in one sentence, phrased the way someone would ask for it.
18
+ - **Skeleton**: the component tree, with the actual imports from this system.
19
+ - **States**: loading, empty, error, permission denied. This is the half agents skip.
20
+ - **Traps**: the mistakes people make on this pattern in this system.
21
+ - **What it is not**: the neighbouring pattern it gets confused with.
22
+
23
+ ## How it should load
24
+
25
+ Not always in context. One file per pattern with a one-line description an agent
26
+ matches against the task, and the body pulled in only when it matches. Always-loaded
27
+ patterns eat the context window that the component guides need.
28
+
29
+ ## Done when
30
+
31
+ - Four or five patterns exist, each with skeleton, states and traps.
32
+ - Each one names the real components it uses, and those imports compile.
@@ -0,0 +1,41 @@
1
+ # Fix: generate prop tables from types
2
+
3
+ **Dimension:** Docs freshness · **Size:** M · **Repo:** {{name}} · **Stack:** {{stack}}
4
+
5
+ A hand-written prop table is a copy of the truth, and copies rot. Generate it.
6
+
7
+ ## What to build
8
+
9
+ A script that reads the built type declarations and rewrites the prop table inside
10
+ each guide, between markers, leaving everything else in the file untouched.
11
+
12
+ 1. Build the package first, then read the emitted `.d.ts` files — not the source.
13
+ The published types are what a consumer sees, and they are not always identical
14
+ to the source.
15
+ 2. For each documented component, resolve its props type and emit a table with
16
+ name, type, required, default and description.
17
+ 3. Write it into the guide between `<!-- props:start -->` and `<!-- props:end -->`.
18
+ Create the block if it is missing. Never touch text outside the markers.
19
+ 4. Preserve hand-written Default and Description cells across regeneration: read
20
+ the existing table first and carry those two columns over by prop name.
21
+ 5. Add the script to CI so it runs, then fails if the working tree changed.
22
+
23
+ Guides live in `{{guidesDir}}`. Components: `{{sourceDir}}`.
24
+
25
+ ## Traps that cost us time
26
+
27
+ - Sort union members. TypeScript returns them in internal order, which differs
28
+ between machines, so an unsorted table makes CI fail on somebody else's laptop.
29
+ - Inherited props from a headless library ({{headless}}) are real props consumers
30
+ pass. Either list them in a separate "Inherited" table with the source interface
31
+ named, or state clearly that they are not covered. Do not silently drop them.
32
+ - Generic props whose type is a type parameter need the base constraint resolved,
33
+ otherwise you print `T` instead of the twelve literal values.
34
+ - Run the formatter after generating, as a separate commit, and check the exit code
35
+ explicitly. A piped command hides a non-zero exit.
36
+
37
+ ## Done when
38
+
39
+ - `{{pkgRun}} <your script>` rewrites every table with no manual step.
40
+ - CI fails when a table is stale.
41
+ - Re-running twice produces no diff.
@@ -0,0 +1,19 @@
1
+ name: Agent readiness
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main, master]
7
+
8
+ jobs:
9
+ score:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-node@v4
14
+ with:
15
+ node-version: 22
16
+ # Fails when the score drops below the committed one, so documentation debt
17
+ # cannot land quietly alongside a feature.
18
+ - name: Score agent readiness
19
+ run: npx --yes adsa-cli@latest audit --gate
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "adsa": {
4
+ "command": "npx",
5
+ "args": ["--yes", "adsa-cli@latest", "mcp"]
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,32 @@
1
+ # Design tokens
2
+
3
+ Tables, not prose. An agent copies from a table and guesses from a paragraph.
4
+
5
+ ## Colour
6
+
7
+ | Token | XML resource / Compose symbol | Use for |
8
+ | :-- | :-- | :-- |
9
+ | `brand_primary` | `colors.xml` → `MaterialTheme.colorScheme.primary` | The main call-to-action colour |
10
+ | _add the rest of your semantic tokens_ | | |
11
+
12
+ ## Spacing
13
+
14
+ | Token | Value | Use for |
15
+ | :-- | :-- | :-- |
16
+ | `space_2` | 8dp | Gap inside a control |
17
+ | _add your scale_ | | |
18
+
19
+ ## Motion
20
+
21
+ | Token | Value | Use for |
22
+ | :-- | :-- | :-- |
23
+ | `duration_fast` | 100ms | Ripple, colour changes |
24
+ | `duration_base` | 200ms | Toggles, small reveals |
25
+ | `duration_slow` | 300ms | Sheets, screen transitions |
26
+
27
+ ## Rules
28
+
29
+ - Product code uses `MaterialTheme.colorScheme` / the theme's typography and shape
30
+ roles, never a hardcoded `Color(0xFF...)` or a raw hex value in layout XML.
31
+ - A value that is not in these tables is a gap: add it to `colors.xml`/`Theme.kt`
32
+ and this file in the same change, or ask — do not inline it.
@@ -0,0 +1,31 @@
1
+ # Design tokens
2
+
3
+ Tables, not prose. An agent copies from a table and guesses from a paragraph.
4
+
5
+ ## Colour
6
+
7
+ | Token | Class | Use for |
8
+ | :-- | :-- | :-- |
9
+ | `--color-bg-primary` | `bg-primary` | Default page and card background |
10
+ | _add the rest of your semantic tokens_ | | |
11
+
12
+ ## Spacing
13
+
14
+ | Token | Value | Use for |
15
+ | :-- | :-- | :-- |
16
+ | `--spacing-2` | 8px | Gap inside a control |
17
+ | _add your scale_ | | |
18
+
19
+ ## Motion
20
+
21
+ | Token | Value | Use for |
22
+ | :-- | :-- | :-- |
23
+ | `--duration-fast` | 100ms | Hover, focus ring, colour changes |
24
+ | `--duration-base` | 200ms | Toggles, small reveals, tooltips |
25
+ | `--duration-slow` | 300ms | Drawers, modals, layout shifts |
26
+ | `--ease-standard` | `cubic-bezier(0.2, 0, 0, 1)` | Anything entering or moving |
27
+
28
+ ## Rules
29
+
30
+ - Product code uses the token classes, never the raw palette.
31
+ - A value that is not in these tables is a gap: add it here or ask, do not inline it.
@@ -0,0 +1,32 @@
1
+ # Design tokens
2
+
3
+ Tables, not prose. An agent copies from a table and guesses from a paragraph.
4
+
5
+ ## Colour
6
+
7
+ | Token | Value (theme key or class) | Use for |
8
+ | :-- | :-- | :-- |
9
+ | `color.bg.primary` | `theme.colors.bgPrimary` | Default screen and card background |
10
+ | _add the rest of your semantic tokens_ | | |
11
+
12
+ ## Spacing
13
+
14
+ | Token | Value | Use for |
15
+ | :-- | :-- | :-- |
16
+ | `space.2` | 8 | Gap inside a control |
17
+ | _add your scale_ | | |
18
+
19
+ ## Motion
20
+
21
+ | Token | Value | Use for |
22
+ | :-- | :-- | :-- |
23
+ | `duration.fast` | 100ms | Press feedback, colour changes |
24
+ | `duration.base` | 200ms | Toggles, small reveals |
25
+ | `duration.slow` | 300ms | Sheets, screen transitions |
26
+
27
+ ## Rules
28
+
29
+ - Product code uses the theme's token values, never a raw color literal in
30
+ `StyleSheet.create` and never a raw palette class if the theme is exposed through
31
+ NativeWind.
32
+ - A value that is not in these tables is a gap: add it here or ask, do not inline it.
@@ -0,0 +1,32 @@
1
+ # Design tokens
2
+
3
+ Tables, not prose. An agent copies from a table and guesses from a paragraph.
4
+
5
+ ## Colour
6
+
7
+ | Token | Swift symbol / asset | Use for |
8
+ | :-- | :-- | :-- |
9
+ | `accentPrimary` | `Color("AccentPrimary")` (asset catalog) | The main call-to-action colour |
10
+ | _add the rest of your semantic tokens_ | | |
11
+
12
+ ## Typography
13
+
14
+ | Token | Swift symbol | Use for |
15
+ | :-- | :-- | :-- |
16
+ | `title` | `.font(.title)` / a custom `ShapeStyle` | Screen titles |
17
+ | _add your scale_ | | |
18
+
19
+ ## Motion
20
+
21
+ | Token | Value | Use for |
22
+ | :-- | :-- | :-- |
23
+ | `durationFast` | 0.1s | Press feedback, colour changes |
24
+ | `durationBase` | 0.2s | Toggles, small reveals |
25
+ | `durationSlow` | 0.3s | Sheets, navigation transitions |
26
+
27
+ ## Rules
28
+
29
+ - Product code uses the named colours and text styles this system ships, never a
30
+ raw `Color(red:green:blue:)` literal or a hardcoded hex string.
31
+ - A value that is not in these tables is a gap: add it to the asset catalog and
32
+ this file in the same change, or ask — do not inline it.